Class: DatabaseConsistency::Checkers::ModelChecker
- Inherits:
-
BaseChecker
- Object
- BaseChecker
- DatabaseConsistency::Checkers::ModelChecker
- Defined in:
- lib/database_consistency/checkers/model_checkers/model_checker.rb
Overview
The base class for model checkers
Direct Known Subclasses
Instance Attribute Summary collapse
-
#model ⇒ Object
readonly
Returns the value of attribute model.
Instance Method Summary collapse
- #column_or_attribute_name ⇒ Object
-
#initialize(model) ⇒ ModelChecker
constructor
A new instance of ModelChecker.
- #table_or_model_name ⇒ Object
Methods inherited from BaseChecker
checker_name, enabled?, #enabled?, #report, #report_if_enabled?
Constructor Details
#initialize(model) ⇒ ModelChecker
Returns a new instance of ModelChecker.
9 10 11 12 |
# File 'lib/database_consistency/checkers/model_checkers/model_checker.rb', line 9 def initialize(model) super() @model = model end |
Instance Attribute Details
#model ⇒ Object (readonly)
Returns the value of attribute model.
7 8 9 |
# File 'lib/database_consistency/checkers/model_checkers/model_checker.rb', line 7 def model @model end |
Instance Method Details
#column_or_attribute_name ⇒ Object
14 15 16 |
# File 'lib/database_consistency/checkers/model_checkers/model_checker.rb', line 14 def column_or_attribute_name nil end |
#table_or_model_name ⇒ Object
18 19 20 |
# File 'lib/database_consistency/checkers/model_checkers/model_checker.rb', line 18 def table_or_model_name @table_or_model_name ||= model.name.to_s end |