aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation/finder_methods.rb
diff options
context:
space:
mode:
authorJosh Kalderimis <josh.kalderimis@gmail.com>2011-04-25 23:56:06 +0200
committerJosh Kalderimis <josh.kalderimis@gmail.com>2011-04-25 23:57:09 +0200
commitf9d5a7bb8c5d224f689dafb4ff641e2ced244f03 (patch)
tree80204955bb82e9f972606514da2710796628225d /activerecord/lib/active_record/relation/finder_methods.rb
parent873c13fc0ddc35e64a6b3abc8bde9721bd12b6b7 (diff)
downloadrails-f9d5a7bb8c5d224f689dafb4ff641e2ced244f03.tar.gz
rails-f9d5a7bb8c5d224f689dafb4ff641e2ced244f03.tar.bz2
rails-f9d5a7bb8c5d224f689dafb4ff641e2ced244f03.zip
deprecated the use of the guard_protected_attributes argument with attributes= in AR in favor of assign_attributes(attrs, :without_protection => true)
Diffstat (limited to 'activerecord/lib/active_record/relation/finder_methods.rb')
-rw-r--r--activerecord/lib/active_record/relation/finder_methods.rb4
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