Sha256: e63d3d75c1869359ef226af47b476a4b3eeed14401fbd0f7b467a3278593f8f4
Contents?: true
Size: 570 Bytes
Versions: 8
Compression:
Stored size: 570 Bytes
Contents
require 'active_model' require 'golden_fleece/validations/validator_context' module GoldenFleece module Validations module ActiveModel class FleeceSchemaConformanceValidator < ::ActiveModel::EachValidator def validate_each(record, attribute, persisted_json) context = record.class.fleece_context errors = ValidatorContext.new(record, attribute, persisted_json, context.schemas[attribute], '/').validate errors.each { |e| record.errors.add attribute, e } errors.empty? end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems