diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-15 15:14:25 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-15 15:14:25 -0700 |
commit | db2e21aa0eed26835d02b874ce97afa6c8abd3e2 (patch) | |
tree | 656d2b248ad7445402393d7cc4d23a6d440dbb93 | |
parent | 66556631f5b98990d55194f427533a4b992b3350 (diff) | |
download | rails-db2e21aa0eed26835d02b874ce97afa6c8abd3e2.tar.gz rails-db2e21aa0eed26835d02b874ce97afa6c8abd3e2.tar.bz2 rails-db2e21aa0eed26835d02b874ce97afa6c8abd3e2.zip |
stop reversing tables until we absolutely must
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency/join_association.rb | 4 |
2 files changed, 3 insertions, 3 deletions
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 |