I'm trying to figure ruby out a bit more.....
If I have an object
@Trees = Tree.find( :all )
Then make a loop where for each tree I find, add some apples...
for tree in @trees
@apples = Apple.where(:tree_location = > tree.id )
end
How can I add the additional apples found from each iteration of the loop to the initial object @apples ?
I tried
@apples = @apples + Apple.where(:tree_location = > tree.id )
but got the error "can't convert Apple into Array"
Thanks for the help .... i'm on a cider deadline lol, corny i know