Count not working?

I’m having some trouble with the count method on AR objects. Here is
a stack trace:

t.subscriptions.count
ArgumentError: wrong number of arguments (2 for 3)
from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/
lib/active_record/calculations.rb:160:in add_limit!' from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/ lib/active_record/calculations.rb:160:inconstruct_calculation_sql’
from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/
lib/active_record/calculations.rb:165:in execute_simple_calculation' from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/ lib/active_record/calculations.rb:144:incalculate’
from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/
lib/active_record/calculations.rb:66:in count' from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/ lib/active_record/associations/has_many_association.rb:47:incount’
from (irb):3

The error seems pretty weird, given that add_limit! seems to take 3
parameters where it’s defined, but the third has a default value and
is thus optional. What’s going on here?

Thanks,
Martin

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs