Sha256: 8e9650e3f897ebb40e6ff3c90cc597b41f353e5d40c2f2203636ad872a330b98

Contents?: true

Size: 238 Bytes

Versions: 27

Compression:

Stored size: 238 Bytes

Contents

module Renalware
  class AddressValidator < ActiveModel::Validator
    def validate(address)
      if address.uk? && address.postcode.blank?
        address.errors[:postcode] << "can't be blank for UK address"
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.rc7 app/validators/renalware/address_validator.rb
renalware-core-2.0.0.pre.rc6 app/validators/renalware/address_validator.rb
renalware-core-2.0.0.pre.rc5 app/validators/renalware/address_validator.rb
renalware-core-2.0.0.pre.rc4 app/validators/renalware/address_validator.rb
renalware-core-2.0.0.pre.rc3 app/validators/renalware/address_validator.rb
renalware-core-2.0.0.pre.rc1 app/validators/renalware/address_validator.rb
renalware-core-2.0.0.pre.beta12 app/validators/renalware/address_validator.rb