Class: CommaHeaven::Sqler::BelongsToColumns
- Inherits:
-
AssociationColumns
- Object
- Array
- Columns
- AssociationColumns
- CommaHeaven::Sqler::BelongsToColumns
- Defined in:
- lib/comma-heaven/sqler/belongs_to_columns.rb
Instance Attribute Summary
Attributes inherited from AssociationColumns
Attributes inherited from Columns
#index, #model, #options, #parent
Instance Method Summary collapse
Methods inherited from AssociationColumns
#foreign_key_for, #initialize, #prefix, #table_alias
Methods inherited from Columns
#initialize, #joins, #prefix, #select, #sql_as, #table, #table_alias
Constructor Details
This class inherits a constructor from CommaHeaven::Sqler::AssociationColumns
Instance Method Details
#join_clause ⇒ Object
4 5 6 7 8 9 |
# File 'lib/comma-heaven/sqler/belongs_to_columns.rb', line 4 def join_clause <<-EOS LEFT JOIN #{quote(table)} AS #{table_alias} ON #{table_alias}.#{model.primary_key} = #{parent.table_alias}.#{foreign_key_for(association)} EOS end |