aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/has_many_through_association.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-05-30 21:40:55 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-05-30 21:40:55 +0000
commit1edd21bb0288526fc3a79ac1f960f4d5e6e6a2f5 (patch)
tree4f15d8d015fca33dafb9e6ebc342262bfe749afc /activerecord/lib/active_record/associations/has_many_through_association.rb
parent962b12fb9f067dac6a5b0d440237628d0e1f2141 (diff)
downloadrails-1edd21bb0288526fc3a79ac1f960f4d5e6e6a2f5.tar.gz
rails-1edd21bb0288526fc3a79ac1f960f4d5e6e6a2f5.tar.bz2
rails-1edd21bb0288526fc3a79ac1f960f4d5e6e6a2f5.zip
with_scope is protected. Closes #8524.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6909 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/associations/has_many_through_association.rb')
-rw-r--r--activerecord/lib/active_record/associations/has_many_through_association.rb6
1 files changed, 3 insertions, 3 deletions
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