Sha256: d4e898a3c0671edd14669e087d6289a1b59dbd1d96efee4396f1ff1110cf1676
Contents?: true
Size: 350 Bytes
Versions: 11
Compression:
Stored size: 350 Bytes
Contents
# frozen_string_literal: true class SequentialValidator < ActiveModel::Validator def validate(record) values = options[:attributes].map do |attribute| record.send(attribute) end.compact if values.sort != values record.errors.add options[:attributes].last, "cannot be before #{options[:attributes].first}" end end end
Version data entries
11 entries across 11 versions & 3 rubygems