class Dynamoid::Validations::ClassMethods::PresenceValidator
Validates that the specified attributes are present (false or not blank).
Public Instance Methods
validate_each(record, attr_name, value)
click to toggle source
Validate the record for the record and value.
# File lib/dynamoid/validations.rb, line 50 def validate_each(record, attr_name, value) record.errors.add(attr_name, :blank, options) if not_present?(value) end
Private Instance Methods
not_present?(value)
click to toggle source
Check whether a value is not present.
# File lib/dynamoid/validations.rb, line 57 def not_present?(value) value.blank? && value != false end