Class: ActiveRecord::ConnectionAdapters::CheckConstraintDefinition
- Inherits:
-
Struct
- Object
- Struct
- ActiveRecord::ConnectionAdapters::CheckConstraintDefinition
- Defined in:
- lib/active_record/connection_adapters/abstract/schema_definitions.rb
Instance Attribute Summary collapse
-
#expression ⇒ Object
Returns the value of attribute expression.
-
#options ⇒ Object
Returns the value of attribute options.
-
#table_name ⇒ Object
Returns the value of attribute table_name.
Instance Method Summary collapse
- #defined_for?(name:, expression: nil, validate: nil, **options) ⇒ Boolean
- #export_name_on_schema_dump? ⇒ Boolean
- #name ⇒ Object
- #validate? ⇒ Boolean (also: #validated?)
Instance Attribute Details
#expression ⇒ Object
Returns the value of attribute expression
174 175 176 |
# File 'lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 174 def expression @expression end |
#options ⇒ Object
Returns the value of attribute options
174 175 176 |
# File 'lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 174 def @options end |
#table_name ⇒ Object
Returns the value of attribute table_name
174 175 176 |
# File 'lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 174 def table_name @table_name end |
Instance Method Details
#defined_for?(name:, expression: nil, validate: nil, **options) ⇒ Boolean
188 189 190 191 192 |
# File 'lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 188 def defined_for?(name:, expression: nil, validate: nil, **) self.name == name.to_s && (validate.nil? || validate == self..fetch(:validate, validate)) && .all? { |k, v| self.[k].to_s == v.to_s } end |
#export_name_on_schema_dump? ⇒ Boolean
184 185 186 |
# File 'lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 184 def export_name_on_schema_dump? !ActiveRecord::SchemaDumper.chk_ignore_pattern.match?(name) if name end |
#name ⇒ Object
175 176 177 |
# File 'lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 175 def name [:name] end |
#validate? ⇒ Boolean Also known as: validated?
179 180 181 |
# File 'lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 179 def validate? .fetch(:validate, true) end |