Sha256: 50c703403650719757a46a61a74b0a002a3a618c8944e6932796d6ad71d53174

Contents?: true

Size: 241 Bytes

Versions: 8

Compression:

Stored size: 241 Bytes

Contents

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.beta11 app/validators/renalware/address_validator.rb
renalware-core-2.0.0.pre.beta10 app/validators/renalware/address_validator.rb
renalware-core-2.0.0.pre.beta9 app/validators/renalware/address_validator.rb
renalware-core-2.0.0.pre.beta8 app/validators/renalware/address_validator.rb
renalware-core-2.0.0.pre.beta7 app/validators/renalware/address_validator.rb
renalware-core-2.0.0.pre.beta6 app/validators/renalware/address_validator.rb
renalware-core-2.0.0.pre.beta5 app/validators/renalware/address_validator.rb
renalware-core-2.0.0.pre.beta4 app/validators/renalware/address_validator.rb