Module: Solid::Validators
- Defined in:
- lib/solid/validators.rb
Class Method Summary collapse
Class Method Details
.add_error(model, attribute, message, options) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/solid/validators.rb', line 5 def self.add_error(model, attribute, , ) if ActiveModel.const_defined?(:Error) model.errors.add(attribute, **.merge(message: )) else model.errors.add(attribute, .fetch(:message, )) end end |