January 22, 2006 22:10
Posted by Jeremy Durham
Returning more than one object
So, apparently I’ve been living under a rock, but no one told me you could return more than one object at a time in Ruby. Take for example:
def return_stuffu = User.find :allo = Order.find :allreturn [u,o]end
and this snippet:
u,o = return_stuff
Now, granted, you probably want to use this when dealing with two items that are a bit more, related to each other, but nonetheless, very cool.








