Permalink
Browse files

Remove side effects of [5684]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5705 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 2f9d44e commit 906bd93f4fdbad429cca8a0cfa7f32ec1eb7960a Tobias Lütke committed Dec 8, 2006
@@ -86,14 +86,14 @@ def destroy_all
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
@@ -7,7 +7,7 @@ def initialize(owner, reflection)
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 @@ def create(attrs = {}, replace_existing = true)
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)

0 comments on commit 906bd93

Please sign in to comment.