Sha256: dfd3773d4aaed1b066bca36ba792ac88124d96ae8ccbd15f155aa3ccef3ea844
Contents?: true
Size: 506 Bytes
Versions: 41
Compression:
Stored size: 506 Bytes
Contents
# frozen_string_literal: true require_relative 'date_eq' class MiniDefender::Rules::DateGt < MiniDefender::Rules::DateEq def self.signature 'date_gt' end def passes?(attribute, value, validator) value = parse_date(value) @valid_value = true value > @target_date rescue ArgumentError false end def message(attribute, value, validator) return "The given value is not a valid date." unless @valid_value "The value must be greater than #{@target_date}." end end
Version data entries
41 entries across 41 versions & 1 rubygems