From bb498a574980eb281f9f5fd5236f584bf23a829d Mon Sep 17 00:00:00 2001 From: knapo Date: Wed, 11 May 2011 17:17:42 +0200 Subject: Fix assigning protected attributes by attributes= --- activerecord/lib/active_record/base.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'activerecord/lib') 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 -- cgit v1.2.3