Skip to content

Instantly share code, notes, and snippets.

@D-Vaillant
Last active March 14, 2016 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save D-Vaillant/d2e5e496e142fa231750 to your computer and use it in GitHub Desktop.
Save D-Vaillant/d2e5e496e142fa231750 to your computer and use it in GitHub Desktop.
A possibly improved bit of Ruby about hashes.
if save_hash[save_loc].empty?
save_hash[save_loc] = {order["Order Number"] => hash_to_row(order, m.ordering)}
else
save_hash[save_loc][order["Order Number"]] = hash_to_row(order, m.ordering)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment