class ActiveModel::Validations::JsonValidator

Public Instance Methods

validate_each(record, attribute, value) click to toggle source
# File lib/json_column/json_validator.rb, line 4
def validate_each(record, attribute, value)
  errors = JSON::Validator.fully_validate(options[:schema], value)
  if errors
    record.errors[attribute] << (errors)
  end
end