aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorknapo <knapo@knapo.net>2011-05-11 17:17:42 +0200
committerknapo <knapo@knapo.net>2011-05-11 17:17:42 +0200
commitbb498a574980eb281f9f5fd5236f584bf23a829d (patch)
tree6f0ac7821c1955e6c6e06ab3ce439ee8b29ec3cd /activerecord/lib/active_record
parent8ec1f30cfdea6c80db1434a9f96c28bb119689d0 (diff)
downloadrails-bb498a574980eb281f9f5fd5236f584bf23a829d.tar.gz
rails-bb498a574980eb281f9f5fd5236f584bf23a829d.tar.bz2
rails-bb498a574980eb281f9f5fd5236f584bf23a829d.zip
Fix assigning protected attributes by attributes=
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/base.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index b2e058d746..e1bf2ccc8a 100644
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -1652,11 +1652,10 @@ MSG
return unless new_attributes.is_a?(Hash)
- guard_protected_attributes ||= true
- if guard_protected_attributes
- assign_attributes(new_attributes)
- else
+ if guard_protected_attributes == false
assign_attributes(new_attributes, :without_protection => true)
+ else
+ assign_attributes(new_attributes)
end
end