Skip to content

Instantly share code, notes, and snippets.

@mariozig
Created October 6, 2011 19:06
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 mariozig/1268326 to your computer and use it in GitHub Desktop.
Save mariozig/1268326 to your computer and use it in GitHub Desktop.
Sort an array of hashes
array_of_hashes = ModelOneAddress.all + ModelTwoAddress.all
array_of_hashes.sort_by { |hsh| hsh[:zip] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment