Sha256: 85f38971ef6744a4bba3fd9c0aa1ad0fe97ade61911cacde2d7ba5d55d6bf138

Contents?: true

Size: 586 Bytes

Versions: 12

Compression:

Stored size: 586 Bytes

Contents

module Comee
  module Core
    class ClientAddress < ApplicationRecord
      SHIPPING_ADDRESS = "Shipping Address".freeze
      DELIVERY_ADDRESS = "Delivery Address".freeze
      INVOICING_ADDRESS = "Invoicing Address".freeze

      ADDRESS_TYPES = [SHIPPING_ADDRESS, DELIVERY_ADDRESS, INVOICING_ADDRESS].freeze

      belongs_to :client
      belongs_to :country, -> { where(lookup_type: :country) }, class_name: "Comee::Core::Lookup"

      validates :name, :address_line1, :address_type, presence: true
      validates :address_type, inclusion: {in: ADDRESS_TYPES}
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
comee_core-0.2.88 app/models/comee/core/client_address.rb
comee_core-0.2.87 app/models/comee/core/client_address.rb
comee_core-0.2.86 app/models/comee/core/client_address.rb
comee_core-0.2.85 app/models/comee/core/client_address.rb
comee_core-0.2.84 app/models/comee/core/client_address.rb
comee_core-0.2.83 app/models/comee/core/client_address.rb
comee_core-0.2.82 app/models/comee/core/client_address.rb
comee_core-0.2.81 app/models/comee/core/client_address.rb
comee_core-0.2.80 app/models/comee/core/client_address.rb
comee_core-0.2.78 app/models/comee/core/client_address.rb
comee_core-0.2.77 app/models/comee/core/client_address.rb
comee_core-0.2.76 app/models/comee/core/client_address.rb