Pessimistic Locking Plugin Breaks ActiveRecord::Base.count()

After installing the PessimisticLocking plugin I noticed that
ActiveRecord’s count method no longer works (see below). If I remove
the plugin it resolves the problem.

I need both. Any ideas?

I have also read that Pessimistic Locking is now baked into ActiveRecord
in Edge Rails. I have tried Rails 1.1.2 and 1.1.4 and that doesn’t seem
to be the case. Any idea when it’ll be in a production release?

  • Don

Job.count
ArgumentError: wrong number of arguments (2 for 3)
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/calculations.rb:156:in
add_limit!' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/calculations.rb:156:inconstruct_calculation_sql’
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/calculations.rb:161:in
execute_simple_calculation' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/calculations.rb:141:incalculate’
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/calculations.rb:64:in
`count’
from (irb):1

On 7/7/06, Don S. [email protected] wrote:

After installing the PessimisticLocking plugin I noticed that
ActiveRecord’s count method no longer works (see below). If I remove
the plugin it resolves the problem.

I need both. Any ideas?
Hi Don,
No ideas about the issue itself.

I have also read that Pessimistic Locking is now baked into ActiveRecord
in Edge Rails. I have tried Rails 1.1.2 and 1.1.4 and that doesn’t seem
to be the case. Any idea when it’ll be in a production release?
Edge Rails contains latest bleeding edge love to Rails and is the
target of new improvements. The 1.1.* series are instead a STABLE
branch of Edge Rails to which only bug fixes and minor non-backward
incompatible changes are committed.
From the RoR weblog: "All of the new features we’ve been working on
over the last couple of months will become available in 1.2.0, which
is scheduled for “soonish”.
Cheers.

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