Sha256: ccb1e131dc81a65913a2ff718cd52257bcc4c71a436bef0f9fb40833910337e1
Contents?: true
Size: 1.09 KB
Versions: 35
Compression:
Stored size: 1.09 KB
Contents
module ActiveRecord module CockroachDB module AttributeMethodsMonkeyPatch private # Filter out rowid so it doesn't get inserted by ActiveRecord. rowid is a # column added by CockroachDB for tables that don't define primary keys. # CockroachDB will automatically insert rowid values. See # https://www.cockroachlabs.com/docs/v19.2/create-table.html#create-a-table. def attributes_for_create(attribute_names) super.reject { |name| name == ConnectionAdapters::CockroachDBAdapter::DEFAULT_PRIMARY_KEY } end # Filter out rowid so it doesn't get updated by ActiveRecord. rowid is a # column added by CockroachDB for tables that don't define primary keys. # CockroachDB will automatically insert rowid values. See # https://www.cockroachlabs.com/docs/v19.2/create-table.html#create-a-table. def attributes_for_update(attribute_names) super.reject { |name| name == ConnectionAdapters::CockroachDBAdapter::DEFAULT_PRIMARY_KEY } end end end class Base prepend CockroachDB::AttributeMethodsMonkeyPatch end end
Version data entries
35 entries across 35 versions & 1 rubygems