mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
1de1041c00
Eventually #engine should go away, but until that time, this means that Table and Nodes::TableAlias can be used more interchangeably.
21 lines
378 B
Ruby
21 lines
378 B
Ruby
module Arel
|
|
module Nodes
|
|
class TableAlias < Arel::Nodes::Binary
|
|
alias :name :right
|
|
alias :relation :left
|
|
alias :table_alias :name
|
|
|
|
def [] name
|
|
Attribute.new(self, name)
|
|
end
|
|
|
|
def table_name
|
|
relation.respond_to?(:name) ? relation.name : name
|
|
end
|
|
|
|
def engine
|
|
relation.engine
|
|
end
|
|
end
|
|
end
|
|
end
|