adding a factory method to the join part for generating a table alias

This commit is contained in:
Aaron Patterson
2010-11-24 13:53:55 -08:00
parent cdf6cf01cb
commit 34d21b87bb
2 changed files with 5 additions and 1 deletions

View File

@@ -35,7 +35,7 @@ module ActiveRecord
def columns
join_parts.collect { |join_part|
table = Arel::Nodes::TableAlias.new join_part.aliased_table_name, nil
table = join_part.aliased_table
join_part.column_names_with_alias.collect{ |column_name, aliased_name|
table[column_name].as aliased_name
}

View File

@@ -21,6 +21,10 @@ module ActiveRecord
@cached_record = {}
end
def aliased_table
Arel::Nodes::TableAlias.new aliased_table_name, table
end
def ==(other)
raise NotImplementedError
end