diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-30 15:39:49 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-30 15:39:49 -0800 |
commit | 7ff980031bc49fe332d3b9ea8fbc6c2aae935db5 (patch) | |
tree | c5437da177a572b3a56edf387fa351868c93e766 | |
parent | dccf624b643398afdf1b0e048e57f04cb182c55e (diff) | |
download | rails-7ff980031bc49fe332d3b9ea8fbc6c2aae935db5.tar.gz rails-7ff980031bc49fe332d3b9ea8fbc6c2aae935db5.tar.bz2 rails-7ff980031bc49fe332d3b9ea8fbc6c2aae935db5.zip |
scope_for_create always returns something
-rw-r--r-- | activerecord/lib/active_record/base.rb | 4 |
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 |