aboutsummaryrefslogblamecommitdiffstats
path: root/lib/arel/nodes/table_alias.rb
blob: b32f057117ca9e438ee4d77862305653a9d7823f (plain) (tree)
1
2
3
4
5
6
7
8
9

              
                                          

                           
                              
 
                 
                                 
         

                    
                                                          
         


       
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
    end
  end
end