Skip to content

Instantly share code, notes, and snippets.

@the-teacher
Created April 2, 2014 09:41
Show Gist options
  • Save the-teacher/9931040 to your computer and use it in GitHub Desktop.
Save the-teacher/9931040 to your computer and use it in GitHub Desktop.
funny.rb
items_ids = folders_items.reduce( Hash.new{|h, k| h[k] = []}){ |hash, x|
hash[x.item_type].push x.item_id
hash
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment