aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-11-30 15:39:49 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2010-11-30 15:39:49 -0800
commit7ff980031bc49fe332d3b9ea8fbc6c2aae935db5 (patch)
treec5437da177a572b3a56edf387fa351868c93e766
parentdccf624b643398afdf1b0e048e57f04cb182c55e (diff)
downloadrails-7ff980031bc49fe332d3b9ea8fbc6c2aae935db5.tar.gz
rails-7ff980031bc49fe332d3b9ea8fbc6c2aae935db5.tar.bz2
rails-7ff980031bc49fe332d3b9ea8fbc6c2aae935db5.zip
scope_for_create always returns something
-rw-r--r--activerecord/lib/active_record/base.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 6076aaf4c3..b972b193e4 100644
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -1830,7 +1830,9 @@ MSG
def populate_with_current_scope_attributes
if scope = self.class.send(:current_scoped_methods)
create_with = scope.scope_for_create
- create_with.each { |att,value| self.respond_to?(:"#{att}=") && self.send("#{att}=", value) } if create_with
+ create_with.each { |att,value|
+ respond_to?(:"#{att}=") && send("#{att}=", value)
+ }
end
end