Class: Shoppe::Address

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/shoppe/address.rb

Constant Summary collapse

TYPES =

An array of all the available types for an address

["billing", "delivery"]

Instance Method Summary collapse

Instance Method Details

#countryShoppe::Country

The country which this address should be linked to

Returns:


23
# File 'app/models/shoppe/address.rb', line 23

belongs_to :country, :class_name => "Shoppe::Country"

#customerShoppe::Customer

The customer which this address should be linked to

Returns:


13
# File 'app/models/shoppe/address.rb', line 13

belongs_to :customer, :class_name => "Shoppe::Customer"

#full_addressObject


39
40
41
# File 'app/models/shoppe/address.rb', line 39

def full_address
  [address1, address2, address3, address4, postcode, country.try(:name)].join(", ")
end

#orderShoppe::Order

The order which this address should be linked to

Returns:


18
# File 'app/models/shoppe/address.rb', line 18

belongs_to :order, :class_name => "Shoppe::Order"