Created
November 8, 2012 19:37
-
-
Save servidorv/4041023 to your computer and use it in GitHub Desktop.
remove duplicates inside each month group
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
def group_by_dates(arr) | |
arr.group_by{|o| [o['date'].year,o['date'].month]} | |
arr.uniq!{|x, v| v['id']} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment