Sha256: 0a8755acac1f0de2d95239ff0d4254235df4c6ed91dce02fae01847a56583aef
Contents?: true
Size: 255 Bytes
Versions: 5
Compression:
Stored size: 255 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('errors.messages.boolean')) end end end
Version data entries
5 entries across 5 versions & 1 rubygems