diff options
Diffstat (limited to 'activerecord/lib/active_record')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 2 | ||||
-rwxr-xr-x | activerecord/lib/active_record/validations.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 6f655df26f..37ed2071cf 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1057,7 +1057,7 @@ module ActiveRecord #:nodoc: # Note: This method is overwritten by the Validation module that'll make sure that updates made with this method # doesn't get subjected to validation checks. Hence, attributes can be updated even if the full object isn't valid. def update_attribute(name, value) - self[name] = value + send(name.to_s + '=', value) save end diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb index 6481e37a25..8f407b25c3 100755 --- a/activerecord/lib/active_record/validations.rb +++ b/activerecord/lib/active_record/validations.rb @@ -661,7 +661,7 @@ module ActiveRecord # This is especially useful for boolean flags on existing records. The regular +update_attribute+ method # in Base is replaced with this when the validations module is mixed in, which it is by default. def update_attribute_with_validation_skipping(name, value) - self[name] = value + send(name.to_s + '=', value) save(false) end |