diff options
author | José Valim <jose.valim@gmail.com> | 2011-04-25 23:58:23 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-04-25 23:58:23 -0700 |
commit | b73c84eaa76da4386dc4b78cdfc75baf0a08f6f2 (patch) | |
tree | b5166a57393b723bf38377f4623fcee23987b1b4 /activerecord/lib/active_record/relation/finder_methods.rb | |
parent | 3a109f78cd403e9257a5765b56ee9363deed0aa4 (diff) | |
parent | f9d5a7bb8c5d224f689dafb4ff641e2ced244f03 (diff) | |
download | rails-b73c84eaa76da4386dc4b78cdfc75baf0a08f6f2.tar.gz rails-b73c84eaa76da4386dc4b78cdfc75baf0a08f6f2.tar.bz2 rails-b73c84eaa76da4386dc4b78cdfc75baf0a08f6f2.zip |
Merged pull request #308 from joshk/assign_attributes.
deprecated the use of guard_protected_attributes with attributes= in AR
Diffstat (limited to 'activerecord/lib/active_record/relation/finder_methods.rb')
-rw-r--r-- | activerecord/lib/active_record/relation/finder_methods.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb index a3d4b7f45a..57c9921ea8 100644 --- a/activerecord/lib/active_record/relation/finder_methods.rb +++ b/activerecord/lib/active_record/relation/finder_methods.rb @@ -279,8 +279,8 @@ module ActiveRecord unless record record = @klass.new do |r| - r.send(:attributes=, protected_attributes_for_create, true) unless protected_attributes_for_create.empty? - r.send(:attributes=, unprotected_attributes_for_create, false) unless unprotected_attributes_for_create.empty? + r.assign_attributes(protected_attributes_for_create) + r.assign_attributes(unprotected_attributes_for_create, :without_protection => true) end yield(record) if block_given? record.save if match.instantiator == :create |