RailsCasts Pro episodes are now free!

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