in my rails app I\'m creating an array like so:
@messages.each do |message|
@list << {
:id => message.id,
:title => message.title,
:ti
Just FYI, I don't see the point in moving the messages into a new list and then sorting them. As long as it is ActiveRecord it should be done directly when querying the database in my opinion.
It looks like you should be able to do it like this:
@messages = Message.includes(:replies).order("replies.created_at ASC")
That should be enough unless I have misunderstood the purpose.