Class: NcsNavigator::Warehouse::Transformers::EnumTransformer::ForeignKeyChecker
- Inherits:
-
Object
- Object
- NcsNavigator::Warehouse::Transformers::EnumTransformer::ForeignKeyChecker
- Includes:
- RecordIdent
- Defined in:
- lib/ncs_navigator/warehouse/transformers/enum_transformer.rb
Instance Attribute Summary collapse
-
#fk_index ⇒ Object
readonly
Returns the value of attribute fk_index.
-
#log ⇒ Object
readonly
Returns the value of attribute log.
Instance Method Summary collapse
-
#initialize(log, fk_index) ⇒ ForeignKeyChecker
constructor
A new instance of ForeignKeyChecker.
- #verify_or_report_errors(record, status) ⇒ Object
Methods included from RecordIdent
Constructor Details
#initialize(log, fk_index) ⇒ ForeignKeyChecker
Returns a new instance of ForeignKeyChecker.
266 267 268 269 |
# File 'lib/ncs_navigator/warehouse/transformers/enum_transformer.rb', line 266 def initialize(log, fk_index) @log = log @fk_index = fk_index end |
Instance Attribute Details
#fk_index ⇒ Object (readonly)
Returns the value of attribute fk_index.
264 265 266 |
# File 'lib/ncs_navigator/warehouse/transformers/enum_transformer.rb', line 264 def fk_index @fk_index end |
#log ⇒ Object (readonly)
Returns the value of attribute log.
264 265 266 |
# File 'lib/ncs_navigator/warehouse/transformers/enum_transformer.rb', line 264 def log @log end |
Instance Method Details
#verify_or_report_errors(record, status) ⇒ Object
271 272 273 274 275 276 277 278 279 280 |
# File 'lib/ncs_navigator/warehouse/transformers/enum_transformer.rb', line 271 def verify_or_report_errors(record, status) log.debug "Verifying FKs for #{record_ident record}" fk_index.verify_or_defer(record).tap do |result| if result log.debug "- All FKs currently resolved." else log.debug "- Deferring because one or more FKs are not resolved." end end end |