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 --- .../lib/active_record/associations/has_many_through_association.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'activerecord/lib/active_record/associations/has_many_through_association.rb') diff --git a/activerecord/lib/active_record/associations/has_many_through_association.rb b/activerecord/lib/active_record/associations/has_many_through_association.rb index 93f1b2ee6a..7a55334912 100644 --- a/activerecord/lib/active_record/associations/has_many_through_association.rb +++ b/activerecord/lib/active_record/associations/has_many_through_association.rb @@ -57,7 +57,7 @@ module ActiveRecord raise_on_type_mismatch(associate) raise ActiveRecord::HasManyThroughCantAssociateNewRecords.new(@owner, through) unless associate.respond_to?(:new_record?) && !associate.new_record? - @owner.send(@reflection.through_reflection.name).proxy_target << klass.with_scope(:create => construct_join_attributes(associate)) { klass.create! } + @owner.send(@reflection.through_reflection.name).proxy_target << klass.send(:with_scope, :create => construct_join_attributes(associate)) { klass.create! } @target << associate if loaded? end end @@ -91,7 +91,7 @@ module ActiveRecord def create!(attrs = nil) @reflection.klass.transaction do - self << @reflection.klass.with_scope(:create => attrs) { @reflection.klass.create! } + self << @reflection.klass.send(:with_scope, :create => attrs) { @reflection.klass.create! } end end @@ -105,7 +105,7 @@ module ActiveRecord if @target.respond_to?(method) || (!@reflection.klass.respond_to?(method) && Class.respond_to?(method)) super else - @reflection.klass.with_scope(construct_scope) { @reflection.klass.send(method, *args, &block) } + @reflection.klass.send(:with_scope, construct_scope) { @reflection.klass.send(method, *args, &block) } end end -- cgit v1.2.3