I have this scope:
scope :total_quantity, sum('quantity')
When I run:
MyModel.total_quantity
I get this error:
NoMethodError: undefined method `default_scoped?' for 4:Fixnum
Running the sum method directly works
MyModel.sum('quantity') # 4
I can't find any documentation on the default_scoped? method, or why it is being called here. Do you know if there is a way to fix this problem?