Class: StoreModel::CombineErrorsStrategies::MarkInvalidErrorStrategy

Inherits:
Object
  • Object
show all
Defined in:
lib/store_model/combine_errors_strategies/mark_invalid_error_strategy.rb

Overview

MarkInvalidErrorStrategy marks attribute invalid in the parent record.

Instance Method Summary collapse

Instance Method Details

#call(attribute, base_errors, _store_model_errors) ⇒ Object

Invalidates attribute in the parent record.

StoreModel::Model attribute

Parameters:

  • attribute (String)

    name of the validated attribute

  • base_errors (ActiveModel::Errors)

    errors object of the parent record

  • _store_model_errors (ActiveModel::Errors)

    errors object of the



13
14
15
# File 'lib/store_model/combine_errors_strategies/mark_invalid_error_strategy.rb', line 13

def call(attribute, base_errors, _store_model_errors)
  base_errors.add(attribute, :invalid)
end