Sha256: 96379643399bdf2879613deafc7d143d7d8a5900ecdf7afa62bb6869e7387d05

Contents?: true

Size: 315 Bytes

Versions: 5

Compression:

Stored size: 315 Bytes

Contents

module CommaHeaven
  module Sqler
    class BelongsToColumns < AssociationColumns
      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
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
comma-heaven-0.8.4 lib/comma-heaven/sqler/belongs_to_columns.rb
comma-heaven-0.8.3 lib/comma-heaven/sqler/belongs_to_columns.rb
comma-heaven-0.8.2 lib/comma-heaven/sqler/belongs_to_columns.rb
comma-heaven-0.8.1 lib/comma-heaven/sqler/belongs_to_columns.rb
comma-heaven-0.8.0 lib/comma-heaven/sqler/belongs_to_columns.rb