When trying to implement pessimistic locking on a Rails model, I'm not able to do so because HTTParty#lock gets called rather than the ActiveRecord method with the same name.
I'm using AR 6.1.4.1 and HTTParty 0.20.0.
User.lock.find(1)
ArgumentError: wrong number of arguments (given 0, expected 1..2) from /Users/elliottg/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/httparty-0.20.0/lib/httparty.rb:587:in lock
Looks like the HTTParty code that's clobbering the AR method is within the HTTParty module line 587 as shown below.
def lock(path, options = {}, &block) perform_request Net::HTTP::Lock, path, options, &block end
I love HTTParty and want to keep using it.
Any ideas for a solution, other than forking? Thanks!