mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
adding a factory method to the join part for generating a table alias
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user