#primary_key
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 132
def primary_key [:primary_key] || default_primary_key end
123456789_123456789_123456789_123456789_123456789_
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
::Struct
|
|
Instance Chain:
self,
::Struct
|
|
Inherits: | Struct |
Defined in: | activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb |
Alias for #validate?.
::Struct
- InheritedBoolean
(readonly)
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 148
def custom_primary_key? [:primary_key] != default_primary_key end
Boolean
(readonly)
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 157
def export_name_on_schema_dump? !ActiveRecord::SchemaDumper.fk_ignore_pattern.match?(name) if name end
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 123
ForeignKeyDefinition = Struct.new(:from_table, :to_table, : )
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 123
ForeignKeyDefinition = Struct.new(:from_table, :to_table, : )
Boolean
(readonly)
Also known as: #validated?
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 152
def validate? .fetch(:validate, true) end
Alias for #validate?.
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 155
alias validated? validate?
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 128
def column [:column] end
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 168
def default_primary_key "id" end
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 144
def deferrable [:deferrable] end
Boolean
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 161
def defined_for?(to_table: nil, validate: nil, ** ) (to_table.nil? || to_table.to_s == self.to_table) && (validate.nil? || validate == self. .fetch(:validate, validate)) && .all? { |k, v| Array(self. [k]).map(&:to_s) == Array(v).map(&:to_s) } end
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 124
def name [:name] end
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 136
def on_delete [:on_delete] end
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 140
def on_update [:on_update] end
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 132
def primary_key [:primary_key] || default_primary_key end