aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/join_dependency/join_association.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-10-20 13:14:48 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-10-20 13:14:48 -0700
commite7bb4bb072b16a715b0a0346b5b127b7c957fae8 (patch)
treed43c44dd1d8b86fe3ba054a8986b6fdf57e4a7cc /activerecord/lib/active_record/associations/join_dependency/join_association.rb
parentbae5e02cf33311318be9c7272852bbaef976bd7e (diff)
downloadrails-e7bb4bb072b16a715b0a0346b5b127b7c957fae8.tar.gz
rails-e7bb4bb072b16a715b0a0346b5b127b7c957fae8.tar.bz2
rails-e7bb4bb072b16a715b0a0346b5b127b7c957fae8.zip
pass the foreign table and class to the join_constraints method
Diffstat (limited to 'activerecord/lib/active_record/associations/join_dependency/join_association.rb')
-rw-r--r--activerecord/lib/active_record/associations/join_dependency/join_association.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/associations/join_dependency/join_association.rb b/activerecord/lib/active_record/associations/join_dependency/join_association.rb
index 9204fa3a56..926d03e495 100644
--- a/activerecord/lib/active_record/associations/join_dependency/join_association.rb
+++ b/activerecord/lib/active_record/associations/join_dependency/join_association.rb
@@ -25,13 +25,10 @@ module ActiveRecord
super && reflection == other.reflection
end
- def join_constraints(parent, join_type, tables, chain)
+ def join_constraints(foreign_table, foreign_klass, join_type, tables, chain)
joins = []
tables = tables.reverse
- foreign_table = parent.table
- foreign_klass = parent.base_klass
-
scope_chain_iter = reflection.scope_chain.reverse_each
# The chain starts with the target table, but we want to end with it here (makes