From 6303cef42c91639642d38a58112b4921927e2ce1 Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Tue, 2 Apr 2013 13:51:30 -0400 Subject: not a relation. it's an arel select manager --- .../associations/join_dependency/join_association.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'activerecord/lib/active_record/associations/join_dependency') 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 0d3b4dbab1..a332034cb0 100644 --- a/activerecord/lib/active_record/associations/join_dependency/join_association.rb +++ b/activerecord/lib/active_record/associations/join_dependency/join_association.rb @@ -59,7 +59,7 @@ module ActiveRecord end end - def join_to(relation) + def join_to(manager) tables = @tables.dup foreign_table = parent_table foreign_klass = parent.active_record @@ -75,7 +75,7 @@ module ActiveRecord foreign_key = reflection.foreign_key when :has_and_belongs_to_many # Join the join table first... - relation.from(join( + manager.from(join( table, table[reflection.foreign_key]. eq(foreign_table[reflection.active_record_primary_key]) @@ -109,13 +109,13 @@ module ActiveRecord constraint = constraint.and(item.arel.constraints) unless item.arel.constraints.empty? end - relation.from(join(table, constraint)) + manager.from(join(table, constraint)) # The current table in this iteration becomes the foreign table in the next foreign_table, foreign_klass = table, reflection.klass end - relation + manager end def build_constraint(reflection, table, key, foreign_table, foreign_key) -- cgit v1.2.3