From 906bd93f4fdbad429cca8a0cfa7f32ec1eb7960a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20L=C3=BCtke?= Date: Fri, 8 Dec 2006 21:41:15 +0000 Subject: Remove side effects of [5684] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5705 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/associations/association_collection.rb | 4 ++-- activerecord/lib/active_record/associations/has_one_association.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/associations/association_collection.rb b/activerecord/lib/active_record/associations/association_collection.rb index 80b7658a95..d3b76e2087 100644 --- a/activerecord/lib/active_record/associations/association_collection.rb +++ b/activerecord/lib/active_record/associations/association_collection.rb @@ -86,14 +86,14 @@ module ActiveRecord end def create(attrs = {}) - record = @reflection.klass.with_scope(construct_scope) { @reflection.klass.create(attrs) } + record = @reflection.klass.with_scope(:create => construct_scope[:create]) { @reflection.klass.create(attrs) } @target ||= [] unless loaded? @target << record record end def create!(attrs = {}) - record = @reflection.klass.with_scope(construct_scope) { @reflection.klass.create!(attrs) } + record = @reflection.klass.with_scope(:create => construct_scope[:create]) { @reflection.klass.create!(attrs) } @target ||= [] unless loaded? @target << record record diff --git a/activerecord/lib/active_record/associations/has_one_association.rb b/activerecord/lib/active_record/associations/has_one_association.rb index 9beddb2ac9..bb541152c1 100644 --- a/activerecord/lib/active_record/associations/has_one_association.rb +++ b/activerecord/lib/active_record/associations/has_one_association.rb @@ -7,7 +7,7 @@ module ActiveRecord end def create(attrs = {}, replace_existing = true) - record = @reflection.klass.with_scope(construct_scope) { @reflection.klass.create(attrs) } + record = @reflection.klass.with_scope(:create => construct_scope[:create]) { @reflection.klass.create(attrs) } if replace_existing replace(record, true) @@ -20,7 +20,7 @@ module ActiveRecord end def create!(attrs = {}, replace_existing = true) - record = @reflection.klass.with_scope(construct_scope) { @reflection.klass.create!(attrs) } + record = @reflection.klass.with_scope(:create => construct_scope[:create]) { @reflection.klass.create!(attrs) } if replace_existing replace(record, true) -- cgit v1.2.3