Я продолжал получать эту ошибку в моем приложении Rails после обновления до Rails 3.
>> u.sent_messages NoMethodError: undefined method `attribute_condition' for #Class:0x105523f18 from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.4/lib/active_record/base.rb:1008:in `method_missing' from /Library/Ruby/Gems/1.8/gems/ar-extensions-0.9.2/lib/ar-extensions/finders.rb:79:in `sanitize_sql_from_hash' from /Library/Ruby/Gems/1.8/gems/ar-extensions-0.9.2/lib/ar-extensions/finders.rb:55:in `each_pair' from /Library/Ruby/Gems/1.8/gems/ar-extensions-0.9.2/lib/ar-extensions/finders.rb:55:in `sanitize_sql_from_hash' from /Library/Ruby/Gems/1.8/gems/ar-extensions-0.9.2/lib/ar-extensions/finders.rb:27:in `sanitize_sql' from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.4/lib/active_record/reflection.rb:131:in `send' from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.4/lib/active_record/reflection.rb:131:in `sanitized_conditions' from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.4/lib/active_record/associations/association_proxy.rb:105:in `conditions' from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.4/lib/active_record/associations/has_many_association.rb:103:in `construct_sql' from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.4/lib/active_record/associations/association_collection.rb:24:in `initialize' from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.4/lib/active_record/associations/has_many_association.rb:11:in `initialize' from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.4/lib/active_record/associations.rb:1492:in `new' from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.4/lib/active_record/associations.rb:1492:in `sent_messages' from (irb):36 from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.4/lib/active_support/callbacks.rb:488
Оказывается, я все еще использовал Gem ar_extensions из http://www.continuousthinking.com/tags/arext а>. С одной стороны, у них есть преемник, с другой - теперь в ActiveRecord есть опция массовой вставки, которую, возможно, стоит проверить (используя Model.create ([hash1, hash2, hash3, ...])).