diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2010-04-28 16:24:47 -0300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-04-28 23:12:03 +0200 |
commit | ce48b3103acd2f58931aa42b93073592b291114e (patch) | |
tree | 3276a234bafc808e1a8f1f9d871733b49e3b0c7a /activerecord | |
parent | b9ab4c780af82c1c60d63c50f040a55da5bfa8db (diff) | |
download | rails-ce48b3103acd2f58931aa42b93073592b291114e.tar.gz rails-ce48b3103acd2f58931aa42b93073592b291114e.tar.bz2 rails-ce48b3103acd2f58931aa42b93073592b291114e.zip |
Makes validates_acceptance_of to not override database fields [#4460 state:committed]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activerecord')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 2d7cfad80d..8542c52d0c 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -931,6 +931,10 @@ module ActiveRecord #:nodoc: subclasses.each { |klass| klass.reset_inheritable_attributes; klass.reset_column_information } end + def attribute_method?(attribute) + super || column_names.include?(attribute.to_s.sub(/=$/, '')) + end + # Set the lookup ancestors for ActiveModel. def lookup_ancestors #:nodoc: klass = self |