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.1.1 app/validators/renalware/address_validator.rb
renalware-core-2.1.0 app/validators/renalware/address_validator.rb
renalware-core-2.0.167 app/validators/renalware/address_validator.rb
renalware-core-2.0.166 app/validators/renalware/address_validator.rb
renalware-core-2.0.165 app/validators/renalware/address_validator.rb
renalware-core-2.0.164 app/validators/renalware/address_validator.rb
renalware-core-2.0.163 app/validators/renalware/address_validator.rb
renalware-core-2.0.162 app/validators/renalware/address_validator.rb
renalware-core-2.0.161 app/validators/renalware/address_validator.rb
renalware-core-2.0.160 app/validators/renalware/address_validator.rb
renalware-core-2.0.159 app/validators/renalware/address_validator.rb
renalware-core-2.0.158 app/validators/renalware/address_validator.rb
renalware-core-2.0.157 app/validators/renalware/address_validator.rb
renalware-core-2.0.156 app/validators/renalware/address_validator.rb
renalware-core-2.0.155 app/validators/renalware/address_validator.rb
renalware-core-2.0.153 app/validators/renalware/address_validator.rb
renalware-core-2.0.152 app/validators/renalware/address_validator.rb
renalware-core-2.0.151 app/validators/renalware/address_validator.rb
renalware-core-2.0.149 app/validators/renalware/address_validator.rb
renalware-core-2.0.148 app/validators/renalware/address_validator.rb