-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
None
Consider the following
def Table include Mongoid::Document field :name field :capacity default_scope order_by('name asc') end
Table.sum(:capacity) # this pukes an error Table.unscoped.sum(:capacity) # this works
I would propose that any order_by Criteria are removed/"switched-off" automatically by aggregation Criteria. Think Arel does this already.