Class: Nandi::Validation::AddIndexValidator

Inherits:
Object
  • Object
show all
Includes:
FailureHelpers
Defined in:
lib/nandi/validation/add_index_validator.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from FailureHelpers

#assert, #collect_errors, #failure, #success

Constructor Details

#initialize(instruction) ⇒ AddIndexValidator



14
15
16
# File 'lib/nandi/validation/add_index_validator.rb', line 14

def initialize(instruction)
  @instruction = instruction
end

Instance Attribute Details

#instructionObject (readonly)

Returns the value of attribute instruction.



27
28
29
# File 'lib/nandi/validation/add_index_validator.rb', line 27

def instruction
  @instruction
end

Class Method Details

.call(instruction) ⇒ Object



10
11
12
# File 'lib/nandi/validation/add_index_validator.rb', line 10

def self.call(instruction)
  new(instruction).call
end

Instance Method Details

#callObject



18
19
20
21
22
23
24
25
# File 'lib/nandi/validation/add_index_validator.rb', line 18

def call
  assert(
    not_using_hash_index?,
    "add_index: Nandi does not support hash indexes. Hash indexes typically have " \
    "very specialized use cases. Please revert to using a btree index, or proceed " \
    "with the creation of this index without using Nandi.",
  )
end