Sha256: 77d5af77c66318a2bddc102628e54419c2f95e0462617cf751c2ce45f7ffef05

Contents?: true

Size: 750 Bytes

Versions: 18

Compression:

Stored size: 750 Bytes

Contents

module ActiveRecord
  module ConnectionAdapters
    module PostgreSQL
      module DatabaseStatements
        def sql_for_insert(sql, pk, id_value, sequence_name, binds) # :nodoc:
          if pk.nil?
            # Extract the table from the insert sql. Yuck.
            table_ref = extract_table_ref_from_insert_sql(sql)
            pk = primary_key(table_ref) if table_ref
          end

          # CPK
          # if pk = suppress_composite_primary_key(pk)
          #  sql = "#{sql} RETURNING #{quote_column_name(pk)}"
          #end
          # NOTE pk can be false.
          if pk
            sql = "#{sql} RETURNING #{quote_column_names(pk)}"
          end

          super
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
composite_primary_keys-11.3.1 lib/composite_primary_keys/connection_adapters/postgresql/database_statements.rb
composite_primary_keys-11.2.0 lib/composite_primary_keys/connection_adapters/postgresql/database_statements.rb
composite_primary_keys-11.1.0 lib/composite_primary_keys/connection_adapters/postgresql/database_statements.rb
composite_primary_keys-11.0.3 lib/composite_primary_keys/connection_adapters/postgresql/database_statements.rb
composite_primary_keys-11.0.2 lib/composite_primary_keys/connection_adapters/postgresql/database_statements.rb
composite_primary_keys-10.0.5 lib/composite_primary_keys/connection_adapters/postgresql/database_statements.rb
composite_primary_keys-11.0.1 lib/composite_primary_keys/connection_adapters/postgresql/database_statements.rb
composite_primary_keys-11.0.0 lib/composite_primary_keys/connection_adapters/postgresql/database_statements.rb
composite_primary_keys-10.0.4 lib/composite_primary_keys/connection_adapters/postgresql/database_statements.rb
composite_primary_keys-10.0.3 lib/composite_primary_keys/connection_adapters/postgresql/database_statements.rb
composite_primary_keys-11.0.0.rc1 lib/composite_primary_keys/connection_adapters/postgresql/database_statements.rb
composite_primary_keys-11.0.0.beta4 lib/composite_primary_keys/connection_adapters/postgresql/database_statements.rb
composite_primary_keys-11.0.0.beta3 lib/composite_primary_keys/connection_adapters/postgresql/database_statements.rb
composite_primary_keys-11.0.0.beta2 lib/composite_primary_keys/connection_adapters/postgresql/database_statements.rb
composite_primary_keys-11.0.0.beta1 lib/composite_primary_keys/connection_adapters/postgresql/database_statements.rb
composite_primary_keys-10.0.2 lib/composite_primary_keys/connection_adapters/postgresql/database_statements.rb
composite_primary_keys-10.0.1 lib/composite_primary_keys/connection_adapters/postgresql/database_statements.rb
composite_primary_keys-10.0.0 lib/composite_primary_keys/connection_adapters/postgresql/database_statements.rb