Sha256: 96f35a868847be4a3787f40e7ed42041fc3008c87f7ac01a867d3b4ac25dce00
Contents?: true
Size: 313 Bytes
Versions: 124
Compression:
Stored size: 313 Bytes
Contents
# An ActiveRecord validator for any radio buttons or select fields with true false # # validates :has_credits, boolean: true class BooleanValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) if value.nil? record.errors.add(attribute, "can't be blank") end end end
Version data entries
124 entries across 124 versions & 1 rubygems