Yes that's it ! ! Thank you, Mike.
On Oct 24, 5:10 pm, "Craig Demyanovich" <[EMAIL PROTECTED]> wrote: > On Fri, Oct 24, 2008 at 10:59 AM, Bensoussan Michael <[EMAIL PROTECTED]>wrote: > > > > > My array is composed by different activerecord objects: > > > my_model1 = Model.find(:all) > > > my_model2 = Model.find(:all) > > > @my_models = my_model1 + mymodel2 > > > and now i'd like to sort @my_models by "created_at" > > @my_models = @my_models.sort_by { |m| m.created_at } > > Note that Enumerable#sort_by returns a new array. > > Regards, > Craig --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---