Skip to content

Instantly share code, notes, and snippets.

@mmacedo
Created April 25, 2012 19:01
Show Gist options
  • Save mmacedo/2492311 to your computer and use it in GitHub Desktop.
Save mmacedo/2492311 to your computer and use it in GitHub Desktop.
Rails array grouping for Mongoid
module Enumerable
def in_groups_of(*args, &block)
to_a.in_groups_of(*args, &block)
end
def in_groups(*args, &block)
to_a.in_groups(*args, &block)
end
def split(*args, &block)
to_a.split(*args, &block)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment