From 1edd21bb0288526fc3a79ac1f960f4d5e6e6a2f5 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Wed, 30 May 2007 21:40:55 +0000 Subject: with_scope is protected. Closes #8524. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6909 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/associations/has_one_association.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/associations/has_one_association.rb') diff --git a/activerecord/lib/active_record/associations/has_one_association.rb b/activerecord/lib/active_record/associations/has_one_association.rb index b18169ab67..59e5486ad6 100644 --- a/activerecord/lib/active_record/associations/has_one_association.rb +++ b/activerecord/lib/active_record/associations/has_one_association.rb @@ -80,7 +80,7 @@ module ActiveRecord # instance. Otherwise, if the target has not previously been loaded # elsewhere, the instance we create will get orphaned. load_target if replace_existing - record = @reflection.klass.with_scope(:create => construct_scope[:create]) { yield @reflection.klass } + record = @reflection.klass.send(:with_scope, :create => construct_scope[:create]) { yield @reflection.klass } if replace_existing replace(record, true) -- cgit v1.2.3