Sha256: cd9c41d043f763a2b0b0718b9e0c58b099a47dd49bb9249e3f0b9bbc9e5d8af3
Contents?: true
Size: 319 Bytes
Versions: 10
Compression:
Stored size: 319 Bytes
Contents
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
10 entries across 10 versions & 2 rubygems