Skip to content

Instantly share code, notes, and snippets.

@servidorv
Created November 8, 2012 19:37
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 servidorv/4041023 to your computer and use it in GitHub Desktop.
Save servidorv/4041023 to your computer and use it in GitHub Desktop.
remove duplicates inside each month group
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