ArgumentError in WelcomeController#index
wrong number of arguments (2 for 1)
Application Trace | Framework Trace | Full Trace
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/active_record/base.rb:2233:in `sanitize_sql_hash_for_conditions'
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/active_record/base.rb:2233:in `sanitize_sql'
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/active_record/base.rb:1494:in `merge_conditions'
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/active_record/base.rb:1492:in `each'
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/active_record/base.rb:1492:in `merge_conditions'
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/active_record/base.rb:1804:in `add_conditions!'
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/active_record/base.rb:1687:in `construct_finder_sql'
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/active_record/base.rb:1548:in `find_every'
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/active_record/base.rb:1505:in `find_initial'
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/active_record/base.rb:613:in `find'
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/active_record/base.rb:1900:in `find_by_remember_token'
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/active_record/base.rb:1885:in `send'
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/active_record/base.rb:1885:in `method_missing'
#63: upgrading to Rails 2.3 yields ArgumentError for dynamic finders
Solved!
Doing something like Post.find_by_title('something') yields something like:
upgrade spatial_adapter
- kueda on August 27, 2009, 06:17 PM UTC
spatial_adapter overrides some methods in ActiveRecord::Base, one of which has a different method signature in Rails 2.3. If your copy of spatial_adapter is out of date, this error will blow up in your face, leaving your face feeling soiled and angry.