Sha256: edd850f0659e83b48b6dc9db733f89cc975d986064babecfc946a1a05d7ae7bb
Contents?: true
Size: 417 Bytes
Versions: 14
Compression:
Stored size: 417 Bytes
Contents
class MyValidator < ActiveModel::Validator def validate(record) [:dob, :joined].each do |date_field| if record.__send__(date_field).nil? record.errors[date_field] << "Can't be blank" end end end end class OverrideErrorClashEmployee < Employee validates_with MyValidator acts_as_gov_uk_date :dob, :joined, error_clash_behaviour: :override_with_gov_uk_date_field_error end
Version data entries
14 entries across 14 versions & 1 rubygems