Sha256: 55f7ad45c3964eeec69b8984fcd2e5b7cb9f7b6a88fe64f62520a4520606b975
Contents?: true
Size: 227 Bytes
Versions: 2
Compression:
Stored size: 227 Bytes
Contents
class BooleanValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) record.errors.add(attribute, :boolean || options[:message], options) unless (value == true || value == false) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
act_a-0.0.2 | spec/dummy/lib/boolean_validator.rb |
act_a-0.0.1 | spec/dummy/lib/boolean_validator.rb |