Class: ActiveRecord::ConnectionAdapters::MySQL::IndexDefinition
Do not use. This class is for internal use only.
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
|
|
|
Instance Chain:
|
|
| Inherits: |
ActiveRecord::ConnectionAdapters::IndexDefinition
|
| Defined in: | activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb |
Overview
Active Record ::ActiveRecord::ConnectionAdapters::MySQL Adapter Index Definition
Class Method Summary
Instance Attribute Summary
- #disabled? ⇒ Boolean readonly
- #enabled readonly
- #lengths readonly
- #type readonly
::ActiveRecord::ConnectionAdapters::IndexDefinition - Inherited
Instance Method Summary
- #as_schema_json
- #column_options
- #defined_for?(columns = nil, enabled: nil, **options) ⇒ Boolean
- #init_from_schema_json(coder, references)
::ActiveRecord::ConnectionAdapters::IndexDefinition - Inherited
Constructor Details
.new(*args, lengths: {}, type: nil, enabled: true, **kwargs) ⇒ IndexDefinition
Instance Attribute Details
#disabled? ⇒ Boolean (readonly)
[ GitHub ]
# File 'activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb', line 71
def disabled? !@enabled end
#enabled (readonly)
[ GitHub ]#lengths (readonly)
[ GitHub ]#type (readonly)
[ GitHub ]Instance Method Details
#as_schema_json
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb', line 75
def as_schema_json json = super json["lengths"] = @lengths.presence json["type"] = @type json["disabled"] = true unless @enabled json end
#column_options
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb', line 62
def super.merge!(length: lengths) end
#defined_for?(columns = nil, enabled: nil, **options) ⇒ Boolean
#init_from_schema_json(coder, references)
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb', line 83
def init_from_schema_json(coder, references) super @lengths = coder["lengths"] || {} @type = coder["type"]&.to_sym @enabled = !coder["disabled"] end