123456789_123456789_123456789_123456789_123456789_

Class: ActiveRecord::Associations::JoinDependency::Aliases::Table

Relationships & Source Files
Inherits: Struct
  • ::Object
Defined in: activerecord/lib/active_record/associations/join_dependency.rb

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#columns (rw)

[ GitHub ]

  
# File 'activerecord/lib/active_record/associations/join_dependency.rb', line 35

class Table < Struct.new(:node, :columns)

#node (rw)

[ GitHub ]

  
# File 'activerecord/lib/active_record/associations/join_dependency.rb', line 35

class Table < Struct.new(:node, :columns)

Instance Method Details

#column_aliases

[ GitHub ]

  
# File 'activerecord/lib/active_record/associations/join_dependency.rb', line 40

def column_aliases
  t = table
  columns.map { |column| t[column.name].as Arel.sql column.alias }
end

#table

[ GitHub ]

  
# File 'activerecord/lib/active_record/associations/join_dependency.rb', line 36

def table
  Arel::Nodes::TableAlias.new node.table, node.aliased_table_name
end