diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-06 02:36:33 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-06 02:36:33 +0000 |
commit | 393e98a85999878d832eaba2da42a8805aff54e8 (patch) | |
tree | 7973683824005bd8cd2d41488b28758194991f37 /activerecord/lib/active_record | |
parent | d1abe806c54a0c0c845476715e47c52ca48cabab (diff) | |
download | rails-393e98a85999878d832eaba2da42a8805aff54e8.tar.gz rails-393e98a85999878d832eaba2da42a8805aff54e8.tar.bz2 rails-393e98a85999878d832eaba2da42a8805aff54e8.zip |
Fixed Base#update_attribute to be indifferent to whether a string or symbol is used to describe the name
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@341 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
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 76b9ea0e36..bd7195a33b 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -828,7 +828,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.to_s] = value + self[name] = value save end diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb index 39eb6c013b..1da73d6dc5 100755 --- a/activerecord/lib/active_record/validations.rb +++ b/activerecord/lib/active_record/validations.rb @@ -293,7 +293,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) - @attributes[name] = value + self[name] = value save(false) end |