class Quby::TypeValidator
validates :key, 'quby/type': {is_a: Symbol}
Public Instance Methods
validate_each(record, attribute, value)
click to toggle source
# File lib/active_model_modules/type_validator.rb, line 3 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