Created
October 6, 2011 19:06
-
-
Save mariozig/1268326 to your computer and use it in GitHub Desktop.
Sort an array of hashes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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