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