aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-xactiverecord/lib/active_record/base.rb2
-rwxr-xr-xactiverecord/lib/active_record/validations.rb1
2 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index c51564ecfc..a783feafed 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -447,7 +447,6 @@ module ActiveRecord #:nodoc:
attributes.collect { |attr| create(attr) }
else
object = new(attributes)
- scope(:create).each { |att,value| object.send("#{att}=", value) } if scoped?(:create)
object.save
object
end
@@ -1504,6 +1503,7 @@ module ActiveRecord #:nodoc:
@new_record = true
ensure_proper_type
self.attributes = attributes unless attributes.nil?
+ self.class.send(:scope, :create).each { |att,value| self.send("#{att}=", value) } if self.class.send(:scoped?, :create)
yield self if block_given?
end
diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb
index 6f284242cd..b8dc5009ea 100755
--- a/activerecord/lib/active_record/validations.rb
+++ b/activerecord/lib/active_record/validations.rb
@@ -721,7 +721,6 @@ module ActiveRecord
attributes.collect { |attr| create(attr) }
else
object = new(attributes)
- scope(:create).each { |att,value| object.send("#{att}=", value) } if scoped?(:create)
object.save!
object
end