Class: UseCaseValidations::Validations::PresenceValidator

Inherits:
EachValidator show all
Defined in:
lib/usecasing_validations/validations/presence.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from EachValidator

#attributes

Attributes inherited from UseCaseValidations::Validator

#base, #options

Instance Method Summary collapse

Methods inherited from EachValidator

#check_validity!, #initialize, #validate

Methods inherited from UseCaseValidations::Validator

#initialize, #validate

Constructor Details

This class inherits a constructor from UseCaseValidations::EachValidator

Instance Method Details

#validate_each(record, attr_name, value) ⇒ Object



5
6
7
# File 'lib/usecasing_validations/validations/presence.rb', line 5

def validate_each(record, attr_name, value)
  record.errors.add(attr_name, :blank, options) if Helpers._blank?(value)
end