sdsykes/read_from_slave — Issue #6: Rails 3.1 bug?
Author: jwoertink
Created: 2011-11-08 19:19:11+00:00
State: open

I'm getting a wrong number of arguments (2 for 1) error using Rails 3.1 and read_from_slave 0.5.1

read_from_slave (0.5.1) lib/read_from_slave.rb:131:in `find_by_sql_with_read_from_slave'
activerecord (3.1.1) lib/active_record/relation.rb:111:in `to_a'
activerecord (3.1.1) lib/active_record/relation/finder_methods.rb:376:in `find_first'
activerecord (3.1.1) lib/active_record/relation/finder_methods.rb:122:in `first'
activerecord (3.1.1) lib/active_record/relation/finder_methods.rb:263:in `find_by_attributes'
activerecord (3.1.1) lib/active_record/base.rb:1063:in `method_missing'
app/models/administrator.rb:33:in `authenticate'

Line 33 Administrator#authenticate is

def self.authenticate(login, password)
u = find_by_login(login)
u && u.authenticated?(password, u.salt) ? u : nil
end

I have my slaves set in my database.yml even using the colon in front of primary_slave. I'm not sure what else to look into.