Sha256: d54ea7e7c3c796acb76691c6397daaf5dda26299f46286fdea0c332fc1c133df

Contents?: true

Size: 269 Bytes

Versions: 142

Compression:

Stored size: 269 Bytes

Contents

# frozen_string_literal: true

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

142 entries across 142 versions & 1 rubygems

Version Path
renalware-core-2.0.147 app/validators/renalware/address_validator.rb
renalware-core-2.0.146 app/validators/renalware/address_validator.rb
renalware-core-2.0.145 app/validators/renalware/address_validator.rb
renalware-core-2.0.144 app/validators/renalware/address_validator.rb
renalware-core-2.0.143 app/validators/renalware/address_validator.rb
renalware-core-2.0.142 app/validators/renalware/address_validator.rb
renalware-core-2.0.141 app/validators/renalware/address_validator.rb
renalware-core-2.0.140 app/validators/renalware/address_validator.rb
renalware-core-2.0.139 app/validators/renalware/address_validator.rb
renalware-core-2.0.138 app/validators/renalware/address_validator.rb
renalware-core-2.0.137 app/validators/renalware/address_validator.rb
renalware-core-2.0.136 app/validators/renalware/address_validator.rb
renalware-core-2.0.135 app/validators/renalware/address_validator.rb
renalware-core-2.0.134 app/validators/renalware/address_validator.rb
renalware-core-2.0.133 app/validators/renalware/address_validator.rb
renalware-core-2.0.132 app/validators/renalware/address_validator.rb
renalware-core-2.0.131 app/validators/renalware/address_validator.rb
renalware-core-2.0.130 app/validators/renalware/address_validator.rb
renalware-core-2.0.129 app/validators/renalware/address_validator.rb
renalware-core-2.0.128 app/validators/renalware/address_validator.rb