From db2e21aa0eed26835d02b874ce97afa6c8abd3e2 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 15 Oct 2013 15:14:25 -0700 Subject: stop reversing tables until we absolutely must --- activerecord/lib/active_record/associations/join_dependency.rb | 2 +- .../active_record/associations/join_dependency/join_association.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb index 68bdd41101..66cc5bd3ac 100644 --- a/activerecord/lib/active_record/associations/join_dependency.rb +++ b/activerecord/lib/active_record/associations/join_dependency.rb @@ -170,7 +170,7 @@ module ActiveRecord reflection.table_name, table_alias_for(reflection, parent, reflection != node.reflection) ) - }.reverse + } end def table_alias_for(reflection, parent, join) 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 b47ee17aff..9677d1219a 100644 --- a/activerecord/lib/active_record/associations/join_dependency/join_association.rb +++ b/activerecord/lib/active_record/associations/join_dependency/join_association.rb @@ -27,7 +27,7 @@ module ActiveRecord def join_constraints(parent, tables, chain) joins = [] - tables = tables.dup + tables = tables.reverse foreign_table = parent.table foreign_klass = parent.base_klass @@ -113,7 +113,7 @@ module ActiveRecord end def table - tables.last + tables.first end def aliased_table_name -- cgit v1.2.3