Module: SchemaPlusPgIndexes::ActiveRecord::ConnectionAdapters::IndexDefinition
- Defined in:
- lib/schema_plus_pg_indexes/active_record/connection_adapters/index_definition.rb
Overview
SchemaPlusPgIndexes extends the IndexDefinition object to return information case sensitivity, expessions, and operator classes
Instance Attribute Summary collapse
-
#expression ⇒ Object
Returns the value of attribute expression.
-
#operator_classes ⇒ Object
Returns the value of attribute operator_classes.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #case_sensitive? ⇒ Boolean
- #conditions ⇒ Object
- #initialize(*args) ⇒ Object
- #kind ⇒ Object
Instance Attribute Details
#expression ⇒ Object
Returns the value of attribute expression.
9 10 11 |
# File 'lib/schema_plus_pg_indexes/active_record/connection_adapters/index_definition.rb', line 9 def expression @expression end |
#operator_classes ⇒ Object
Returns the value of attribute operator_classes.
10 11 12 |
# File 'lib/schema_plus_pg_indexes/active_record/connection_adapters/index_definition.rb', line 10 def operator_classes @operator_classes end |
Instance Method Details
#==(other) ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/schema_plus_pg_indexes/active_record/connection_adapters/index_definition.rb', line 34 def ==(other) return false if not super other return false unless self.expression == other.expression return false unless !!self.case_sensitive? == !!other.case_sensitive? return false unless self.operator_classes == other.operator_classes return true end |
#case_sensitive? ⇒ Boolean
12 13 14 |
# File 'lib/schema_plus_pg_indexes/active_record/connection_adapters/index_definition.rb', line 12 def case_sensitive? @case_sensitive end |
#conditions ⇒ Object
16 17 18 19 |
# File 'lib/schema_plus_pg_indexes/active_record/connection_adapters/index_definition.rb', line 16 def conditions ActiveSupport::Deprecation.warn "ActiveRecord IndexDefinition#conditions is deprecated, used #where instead" where end |
#initialize(*args) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/schema_plus_pg_indexes/active_record/connection_adapters/index_definition.rb', line 26 def initialize(*args) super = args.dup. @expression = [:expression] @operator_classes = [:operator_classes] || {} @case_sensitive = .include?(:case_sensitive) ? [:case_sensitive] : true end |
#kind ⇒ Object
21 22 23 24 |
# File 'lib/schema_plus_pg_indexes/active_record/connection_adapters/index_definition.rb', line 21 def kind ActiveSupport::Deprecation.warn "ActiveRecord IndexDefinition#kind is deprecated, used #using.to_s instead" using.to_s end |