Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Daisuke Adachi's Profile

GitHub User: dadachi

Site: http://www.bestforce.org/

Comments by Daisuke Adachi

Avatar
ruby
def sorted_messages
  the_messages = messages.arrange(order: :created_at)
  sorted_messages = the_messages.sort_by{ |key, value| key[:updated_at] }.reverse
  Hash[sorted_messages]
end