This project is archived and is in readonly mode.

#3274 ✓stale
Joe Van Dyk

When an ActiveRecord has a column named 'field', bad behavior happens

Reported by Joe Van Dyk | September 27th, 2009 @ 12:56 AM

I've attached a patch showing the broken test.

If Blarg has a string column named 'field', creating a Blarg instance results in the following:

@@@>> a = Blarg.new => #

a.field = {:elad => 'elad'} ArgumentError: wrong number of arguments (4 for 1)

from /Users/eladmeidar/projects/bugmash/vendor/rails/activerecord/lib/../../activemodel/lib/active_model/attribute_methods.rb:147:in attribute_changed?'<br/> from /Users/eladmeidar/projects/bugmash/vendor/rails/activerecord/lib/../../activemodel/lib/active_model/attribute_methods.rb:147:insend'
from /Users/eladmeidar/projects/bugmash/vendor/rails/activerecord/lib/../../activemodel/lib/active_model/attribute_methods.rb:147:in field_changed?'<br/> from /Users/eladmeidar/projects/bugmash/vendor/rails/activerecord/lib/active_record/attribute_methods/dirty.rb:153:inwrite_attribute'
from /Users/eladmeidar/projects/bugmash/vendor/rails/activerecord/lib/active_record/attribute_methods/write.rb:13:in field='<br/> from /Users/eladmeidar/projects/bugmash/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:35:insend'
from /Users/eladmeidar/projects/bugmash/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:35:in method_missing'<br/> from (irb):3 @@@

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Referenced by

Pages