aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorTobias Lütke <tobias.luetke@gmail.com>2006-12-08 21:41:15 +0000
committerTobias Lütke <tobias.luetke@gmail.com>2006-12-08 21:41:15 +0000
commit906bd93f4fdbad429cca8a0cfa7f32ec1eb7960a (patch)
tree46d806faa71189765af0899bcba3efe3c7d41e46 /activerecord
parent2f9d44e50beb7c51fd26bf900c4d18986c9ab754 (diff)
downloadrails-906bd93f4fdbad429cca8a0cfa7f32ec1eb7960a.tar.gz
rails-906bd93f4fdbad429cca8a0cfa7f32ec1eb7960a.tar.bz2
rails-906bd93f4fdbad429cca8a0cfa7f32ec1eb7960a.zip
Remove side effects of [5684]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5705 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/associations/association_collection.rb4
-rw-r--r--activerecord/lib/active_record/associations/has_one_association.rb4
2 files changed, 4 insertions, 4 deletions
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)