diff options
Diffstat (limited to 'activerecord/lib/active_record/associations/join_helper.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/join_helper.rb | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/activerecord/lib/active_record/associations/join_helper.rb b/activerecord/lib/active_record/associations/join_helper.rb index 5a41b40c8f..f345d16841 100644 --- a/activerecord/lib/active_record/associations/join_helper.rb +++ b/activerecord/lib/active_record/associations/join_helper.rb @@ -10,21 +10,12 @@ module ActiveRecord private def construct_tables - tables = [] - chain.each do |reflection| - tables << alias_tracker.aliased_table_for( + chain.map do |reflection| + alias_tracker.aliased_table_for( table_name_for(reflection), table_alias_for(reflection, reflection != self.reflection) ) - - if reflection.source_macro == :has_and_belongs_to_many - tables << alias_tracker.aliased_table_for( - (reflection.source_reflection || reflection).join_table, - table_alias_for(reflection, true) - ) - end end - tables end def table_name_for(reflection) |