Sha256: fcb4a17f0eb84c4e7eb5bee12c76e5bf8c7a7563e6307cb59159ec6578ee52ef
Contents?: true
Size: 284 Bytes
Versions: 23
Compression:
Stored size: 284 Bytes
Contents
# frozen_string_literal: true class StyleValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) return if value.in?(valid_styles = record.class::STYLES) record.errors.add(attribute, :inclusion, valid_styles: valid_styles.to_sentence) end end
Version data entries
23 entries across 23 versions & 1 rubygems