Class: CommaHeaven::Sqler::HasOneColumns
- Inherits:
-
AssociationColumns
- Object
- Array
- Columns
- AssociationColumns
- CommaHeaven::Sqler::HasOneColumns
- Defined in:
- lib/comma-heaven/sqler/has_one_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/has_one_columns.rb', line 4 def join_clause <<-EOS LEFT JOIN #{quote(table)} AS #{table_alias} ON #{parent.table_alias}.#{model.primary_key} = #{table_alias}.#{foreign_key_for(association)} EOS end |