Class: ModelValidator::LogHandler
- Inherits:
-
Object
- Object
- ModelValidator::LogHandler
- Defined in:
- lib/model_validator/log_handler.rb
Overview
This handler logs validation progression
Instance Method Summary collapse
Instance Method Details
#on_new_class(model_class) ⇒ Object
8 9 10 |
# File 'lib/model_validator/log_handler.rb', line 8 def on_new_class(model_class) Rails.logger.info "Checking #{model_class.count} #{model_class}…" end |
#on_violation(model) ⇒ Object
12 13 14 |
# File 'lib/model_validator/log_handler.rb', line 12 def on_violation(model) Rails.logger.error "#<#{model.class} id: #{model.id}, errors: #{model.errors.}>" unless model.valid? end |