1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Remove side effects of [5684]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5705 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Tobias Lütke 2006-12-08 21:41:15 +00:00
parent 2f9d44e50b
commit 906bd93f4f
2 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -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)