Class: ActiveRecord::ConnectionAdapters::PostgreSQL::UniqueConstraintDefinition
- Inherits:
-
Struct
- Object
- Struct
- ActiveRecord::ConnectionAdapters::PostgreSQL::UniqueConstraintDefinition
- Defined in:
- lib/active_record/connection_adapters/postgresql/schema_definitions.rb
Instance Attribute Summary collapse
-
#column ⇒ Object
Returns the value of attribute column.
-
#options ⇒ Object
Returns the value of attribute options.
-
#table_name ⇒ Object
Returns the value of attribute table_name.
Instance Method Summary collapse
- #deferrable ⇒ Object
- #defined_for?(name: nil, column: nil, **options) ⇒ Boolean
- #export_name_on_schema_dump? ⇒ Boolean
- #name ⇒ Object
- #nulls_not_distinct ⇒ Object
- #using_index ⇒ Object
Instance Attribute Details
#column ⇒ Object
Returns the value of attribute column
214 215 216 |
# File 'lib/active_record/connection_adapters/postgresql/schema_definitions.rb', line 214 def column @column end |
#options ⇒ Object
Returns the value of attribute options
214 215 216 |
# File 'lib/active_record/connection_adapters/postgresql/schema_definitions.rb', line 214 def @options end |
#table_name ⇒ Object
Returns the value of attribute table_name
214 215 216 |
# File 'lib/active_record/connection_adapters/postgresql/schema_definitions.rb', line 214 def table_name @table_name end |
Instance Method Details
#deferrable ⇒ Object
219 220 221 |
# File 'lib/active_record/connection_adapters/postgresql/schema_definitions.rb', line 219 def deferrable [:deferrable] end |
#defined_for?(name: nil, column: nil, **options) ⇒ Boolean
235 236 237 238 239 |
# File 'lib/active_record/connection_adapters/postgresql/schema_definitions.rb', line 235 def defined_for?(name: nil, column: nil, **) (name.nil? || self.name == name.to_s) && (column.nil? || Array(self.column) == Array(column).map(&:to_s)) && .all? { |k, v| self.[k].to_s == v.to_s } end |
#export_name_on_schema_dump? ⇒ Boolean
231 232 233 |
# File 'lib/active_record/connection_adapters/postgresql/schema_definitions.rb', line 231 def export_name_on_schema_dump? !ActiveRecord::SchemaDumper.unique_ignore_pattern.match?(name) if name end |
#name ⇒ Object
215 216 217 |
# File 'lib/active_record/connection_adapters/postgresql/schema_definitions.rb', line 215 def name [:name] end |
#nulls_not_distinct ⇒ Object
227 228 229 |
# File 'lib/active_record/connection_adapters/postgresql/schema_definitions.rb', line 227 def nulls_not_distinct [:nulls_not_distinct] end |
#using_index ⇒ Object
223 224 225 |
# File 'lib/active_record/connection_adapters/postgresql/schema_definitions.rb', line 223 def using_index [:using_index] end |