Sha256: 251da9f185a6e4715373c5b84672d0ad0ef81bccb436fcb0fcfe32af03d5cc29
Contents?: true
Size: 372 Bytes
Versions: 60
Compression:
Stored size: 372 Bytes
Contents
# frozen_string_literal: true # This validator ensures timezones are valid. This is, supported by ActiveSupport::TimeZone class TimeZoneValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) return if value.blank? record.errors.add(attribute, options[:message] || :invalid_time_zone) unless ActiveSupport::TimeZone[value] end end
Version data entries
60 entries across 60 versions & 1 rubygems