Sha256: 55bc32c2f1e37e090f4f48446c222155685e8c5d6366c541ef8457ba780dcf69
Contents?: true
Size: 272 Bytes
Versions: 11
Compression:
Stored size: 272 Bytes
Contents
class BooleanValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) unless [true, false, 1, 0].include?(value) record.errors[attribute] << (options[:message] || I18n.t('flash_validators.errors.messages.boolean')) end end end
Version data entries
11 entries across 11 versions & 1 rubygems