lib/mongoid/report/scope.rb in mongoid-report-0.1.1 vs lib/mongoid/report/scope.rb in mongoid-report-0.1.2
- old
+ new
@@ -18,11 +18,11 @@
end
def all
self.yield unless yielded?
queries = compile_queries
- Collection.new(klass.collection.aggregate(queries), fields)
+ Collection.new(klass.collection.aggregate(queries), fields, columns)
end
private
def compile_queries
@@ -52,9 +52,13 @@
def fields
# We need to use here only output field names it could be different
# than defined colunms, Example: field1: 'report-field-name'
context.class.settings_property(report_name, :fields).values
+ end
+
+ def columns
+ context.class.settings_property(report_name, :columns)
end
end
end
end