Skip to content

Instantly share code, notes, and snippets.

@oivoodoo
Created July 22, 2014 09:56
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 oivoodoo/a4ce1956dc66fae53f2c to your computer and use it in GitHub Desktop.
Save oivoodoo/a4ce1956dc66fae53f2c to your computer and use it in GitHub Desktop.
report_klass = Class.new do
include Mongoid::Report
report 'example' do
columns :field4 => ->(context, row, options) { row['field3'] }
column :field3, :field4
attach_to 'pregenerated' do
group_by :field1
end
attach_to Model do
group_by :field1, :field2
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment