treat create! like create and make sure the target is loaded first

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5882 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jamis Buck 2007-01-11 18:10:42 +00:00
parent c398e83893
commit 0d34c28199

@ -24,6 +24,7 @@ def create(attrs = {}, replace_existing = true)
end
def create!(attrs = {}, replace_existing = true)
load_target if replace_existing
record = @reflection.klass.with_scope(:create => construct_scope[:create]) { @reflection.klass.create!(attrs) }
if replace_existing