module SchemaPlusPgIndexes::ActiveRecord::ConnectionAdapters::IndexDefinition

SchemaPlusPgIndexes extends the IndexDefinition object to return information case sensitivity, expressions, and operator classes

SchemaPlusPgIndexes extends the IndexDefinition object to return information case sensitivity, expressions, and operator classes

Attributes

expression[RW]
operator_classes[RW]

Public Class Methods

new(*args) click to toggle source
Calls superclass method
# File lib/schema_plus_pg_indexes/active_record/connection_adapters/index_definition.rb, line 26
def initialize(*args)
  super
  options = args.dup.extract_options!
  @expression = options[:expression]
  @operator_classes = options[:operator_classes] || {}
  @case_sensitive = options.include?(:case_sensitive) ? options[:case_sensitive] : true
end

Public Instance Methods

==(other) click to toggle source
Calls superclass method
# 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?() click to toggle source
# File lib/schema_plus_pg_indexes/active_record/connection_adapters/index_definition.rb, line 12
def case_sensitive?
  @case_sensitive
end
conditions() click to toggle source
# 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
kind() click to toggle source
# 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