Sha256: fb2c04bcc2fc2be789f7200edba4e4400c9b76bee25880c0ede5abfd7b2eef13

Contents?: true

Size: 408 Bytes

Versions: 16

Compression:

Stored size: 408 Bytes

Contents

module Arel
  module Visitors
    class ToSql
      def visit_CompositePrimaryKeys_CompositeKeys o, collector
        values = o.map do |key|
          case key
            when Arel::Attributes::Attribute
              "#{key.relation.name}.#{key.name}"
            else
              key
          end
        end
        collector << "(#{values.join(', ')})"
        collector
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
composite_primary_keys-14.0.9 lib/composite_primary_keys/arel/to_sql.rb
composite_primary_keys-14.0.8 lib/composite_primary_keys/arel/to_sql.rb
composite_primary_keys-13.0.8 lib/composite_primary_keys/arel/to_sql.rb
composite_primary_keys-14.0.7 lib/composite_primary_keys/arel/to_sql.rb
composite_primary_keys-14.0.6 lib/composite_primary_keys/arel/to_sql.rb
composite_primary_keys-13.0.7 lib/composite_primary_keys/arel/to_sql.rb
composite_primary_keys-13.0.6 lib/composite_primary_keys/arel/to_sql.rb
composite_primary_keys-14.0.5 lib/composite_primary_keys/arel/to_sql.rb
composite_primary_keys-13.0.5 lib/composite_primary_keys/arel/to_sql.rb
composite_primary_keys-13.0.4 lib/composite_primary_keys/arel/to_sql.rb
composite_primary_keys-14.0.4 lib/composite_primary_keys/arel/to_sql.rb
composite_primary_keys-14.0.3 lib/composite_primary_keys/arel/to_sql.rb
composite_primary_keys-13.0.3 lib/composite_primary_keys/arel/to_sql.rb
composite_primary_keys-14.0.2 lib/composite_primary_keys/arel/to_sql.rb
composite_primary_keys-13.0.2 lib/composite_primary_keys/arel/to_sql.rb
composite_primary_keys-14.0.1 lib/composite_primary_keys/arel/to_sql.rb