class Sequent::Core::Helpers::StringValidator

Validates String’s Automatically included when using a

attrs value: String

Basically all ruby String are valid Strings.

For now we do fail when value is not a String or contains a any chars defined in ValueValidators::INVALID_CHARS

Public Instance Methods

validate_each(subject, attribute, value) click to toggle source
# File lib/sequent/core/helpers/string_validator.rb, line 20
def validate_each(subject, attribute, value)
  unless Sequent::Core::Helpers::ValueValidators.for(String).valid_value?(value)
    subject.errors.add attribute,
                       :invalid_string
  end
end