У меня есть эта 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 called here. Знаете ли вы, есть ли способ исправить эту проблему?