public
Created

  • Download Gist
gistfile1.rb
Ruby
1 2 3 4 5 6
result = {}
Post.all.each do |post|
result[post.created_at.year] ||= {}
result[post.created_at.year][post.created_at.month] ||= []
result[post.created_at.year][post.created_at.month] << post
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.