diff options
author | Michael Koziarski <michael@koziarski.com> | 2006-01-14 08:26:20 +0000 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2006-01-14 08:26:20 +0000 |
commit | f41feb349caed7580ba0493e3bb2e393cdb45ddb (patch) | |
tree | 1356efda0eb6b52f378eda96c78e52d3421e09ad /activerecord/lib/active_record | |
parent | f9e0ba2913052f34d4873ba804502d91ae2f6ca7 (diff) | |
download | rails-f41feb349caed7580ba0493e3bb2e393cdb45ddb.tar.gz rails-f41feb349caed7580ba0493e3bb2e393cdb45ddb.tar.bz2 rails-f41feb349caed7580ba0493e3bb2e393cdb45ddb.zip |
Don't alter the Hash passed to attributes=, closes #3385
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3417 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index dc3dc2afa6..00f98d51d3 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1334,8 +1334,9 @@ module ActiveRecord #:nodoc: # from this form of mass-assignment by using the +attr_protected+ macro. Or you can alternatively # specify which attributes *can* be accessed in with the +attr_accessible+ macro. Then all the # attributes not included in that won't be allowed to be mass-assigned. - def attributes=(attributes) - return if attributes.nil? + def attributes=(attrs) + return if attrs.nil? + attributes= attrs.dup attributes.stringify_keys! multi_parameter_attributes = [] |