1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

map the association chain to table names

This commit is contained in:
Aaron Patterson 2013-10-03 11:04:29 -07:00
parent c48c111bb2
commit 680464bd2f

View file

@ -10,14 +10,12 @@ module ActiveRecord
private private
def construct_tables def construct_tables
tables = [] chain.map do |reflection|
chain.each do |reflection| alias_tracker.aliased_table_for(
tables << alias_tracker.aliased_table_for(
table_name_for(reflection), table_name_for(reflection),
table_alias_for(reflection, reflection != self.reflection) table_alias_for(reflection, reflection != self.reflection)
) )
end end
tables
end end
def table_name_for(reflection) def table_name_for(reflection)