Sha256: 4ecc539663f8efd9ce2d7f206478a636d6d06219a6412137b6b5f27c41db12f1
Contents?: true
Size: 268 Bytes
Versions: 33
Compression:
Stored size: 268 Bytes
Contents
# validates :key, 'quby/type': {is_a: Symbol} class Quby::TypeValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) return if value.is_a? options[:is_a] record.errors.add(attribute, "Is not of type #{options[:is_a]}") end end
Version data entries
33 entries across 33 versions & 1 rubygems