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.16 app/validators/renalware/address_validator.rb
renalware-core-2.0.15 app/validators/renalware/address_validator.rb
renalware-core-2.0.14 app/validators/renalware/address_validator.rb
renalware-core-2.0.13 app/validators/renalware/address_validator.rb
renalware-core-2.0.12 app/validators/renalware/address_validator.rb
renalware-core-2.0.11 app/validators/renalware/address_validator.rb
renalware-core-2.0.9 app/validators/renalware/address_validator.rb
renalware-core-2.0.8 app/validators/renalware/address_validator.rb
renalware-core-2.0.7 app/validators/renalware/address_validator.rb
renalware-core-2.0.5 app/validators/renalware/address_validator.rb
renalware-core-2.0.4 app/validators/renalware/address_validator.rb
renalware-core-2.0.3 app/validators/renalware/address_validator.rb
renalware-core-2.0.2 app/validators/renalware/address_validator.rb
renalware-core-2.0.1 app/validators/renalware/address_validator.rb
renalware-core-2.0.0 app/validators/renalware/address_validator.rb
renalware-core-2.0.0.pre.rc13 app/validators/renalware/address_validator.rb
renalware-core-2.0.0.pre.rc11 app/validators/renalware/address_validator.rb
renalware-core-2.0.0.pre.rc10 app/validators/renalware/address_validator.rb
renalware-core-2.0.0.pre.rc9 app/validators/renalware/address_validator.rb
renalware-core-2.0.0.pre.rc8 app/validators/renalware/address_validator.rb