Skip to content

Instantly share code, notes, and snippets.

@uptownhr
Last active August 29, 2015 14:15
Show Gist options
  • Save uptownhr/31e682f210bd0be12c35 to your computer and use it in GitHub Desktop.
Save uptownhr/31e682f210bd0be12c35 to your computer and use it in GitHub Desktop.
trans_ids = transactions.all.inject({}) do |hash, trx|
if hash[trx.mid_id].nil?
hash[trx.mid_id] = []
end
hash[trx.mid_id].push trx.id
end
PP.pp trans_ids
//output is
[8]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment