почему использование суммы в рельсовой области видимости 3.1 приводит к ошибке?

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

8
задан Nathan Manousos 9 September 2011 в 18:55
поделиться