Sha256: 83447c46f6e5caea5684a6bd76e220ac296bc277af1c2f7ae7edfa1e5d3faa63
Contents?: true
Size: 443 Bytes
Versions: 23
Compression:
Stored size: 443 Bytes
Contents
module Riveter class BooleanessValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) unless [true, false].include?(value) record.errors.add(attribute, :booleaness, :value => value) end end end end # add compatibility with ActiveModel validates method which # matches option keys to their validator class ActiveModel::Validations::BooleanessValidator = Riveter::BooleanessValidator
Version data entries
23 entries across 23 versions & 1 rubygems