Sha256: d3da8ad2b22214d3547319a6881613ecf30bb9c736d413d03dd0485a8e299a61
Contents?: true
Size: 265 Bytes
Versions: 8
Compression:
Stored size: 265 Bytes
Contents
# frozen_string_literal: true class SubsetValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) superset = options[:of] rest = value - superset record.errors.add(attribute, :subset, **options) unless rest.empty? end end
Version data entries
8 entries across 8 versions & 1 rubygems