class Sequent::Core::Helpers::TimeValidator

Validates Time Automatically included when using a

attrs value: Time

Public Instance Methods

validate_each(subject, attribute, value) click to toggle source
# File lib/sequent/core/helpers/time_validator.rb, line 13
def validate_each(subject, attribute, value)
  return if value.is_a?(Time)

  Time.deserialize_from_json(value)
rescue StandardError
  subject.errors.add attribute, :invalid_time
end