Class: Dynamoid::Validations::ClassMethods::PresenceValidator

Inherits:
ActiveModel::EachValidator
  • Object
show all
Defined in:
lib/dynamoid/validations.rb

Overview

Validates that the specified attributes are present (false or not blank).

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attr_name, value) ⇒ Object

Validate the record for the record and value.



51
52
53
# File 'lib/dynamoid/validations.rb', line 51

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