Class: DatabaseConsistency::Checkers::IndexChecker

Inherits:
BaseChecker
  • Object
show all
Defined in:
lib/database_consistency/checkers/index_checkers/index_checker.rb

Overview

The base class for index checkers

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseChecker

checker_name, enabled?, #enabled?, inherited, #report, #report_if_enabled?

Constructor Details

#initialize(model, index) ⇒ IndexChecker

Returns a new instance of IndexChecker.



13
14
15
16
17
# File 'lib/database_consistency/checkers/index_checkers/index_checker.rb', line 13

def initialize(model, index)
  super()
  @model = model
  @index = index
end

Instance Attribute Details

#indexObject (readonly)

Returns the value of attribute index.



7
8
9
# File 'lib/database_consistency/checkers/index_checkers/index_checker.rb', line 7

def index
  @index
end

#modelObject (readonly)

Returns the value of attribute model.



7
8
9
# File 'lib/database_consistency/checkers/index_checkers/index_checker.rb', line 7

def model
  @model
end

Class Method Details

.processorObject



9
10
11
# File 'lib/database_consistency/checkers/index_checkers/index_checker.rb', line 9

def self.processor
  Processors::IndexesProcessor
end

Instance Method Details

#column_or_attribute_nameObject



19
20
21
# File 'lib/database_consistency/checkers/index_checkers/index_checker.rb', line 19

def column_or_attribute_name
  @column_or_attribute_name ||= index.name.to_s
end

#table_or_model_nameObject



23
24
25
# File 'lib/database_consistency/checkers/index_checkers/index_checker.rb', line 23

def table_or_model_name
  @table_or_model_name ||= model.name.to_s
end