Module: ServiceCore::StepValidation
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/service_core/step_validation.rb
Instance Method Summary collapse
- #add_error(attribute, message, options = {}) ⇒ Object
- #add_error_and_validate(attribute, message, options = {}) ⇒ Object
Instance Method Details
#add_error(attribute, message, options = {}) ⇒ Object
15 16 17 18 19 |
# File 'lib/service_core/step_validation.rb', line 15 def add_error(attribute, , = {}) value = .empty? ? : [, ] @local_errors[attribute] ||= [] @local_errors[attribute] << value end |
#add_error_and_validate(attribute, message, options = {}) ⇒ Object
21 22 23 24 |
# File 'lib/service_core/step_validation.rb', line 21 def add_error_and_validate(attribute, , = {}) add_error(attribute, , ) valid? end |