Sha256: 6ce56de972d7227beb68235aeafd2b5a03a7d6c2857020f821bc7eadfb02c100
Contents?: true
Size: 307 Bytes
Versions: 40
Compression:
Stored size: 307 Bytes
Contents
module Ecom module Core class DateRangeValidator < ActiveModel::Validator def validate(record) return unless record.start_date && record.end_date && record.start_date > record.end_date record.errors.add(:base, 'End date cannot be before start date') end end end end
Version data entries
40 entries across 40 versions & 1 rubygems