Address
model in the spree
gem is used to track address information, mainly for orders. Address information can also be tied to the Spree::User
objects which come from the Spree Auth Devise extension.firstname
: The first name for the person at this address.lastname
: The last name for the person at this address.address1
: The address's first line.address2
: The address's second line.city
: The city where the address is.zipcode
: The postal code.phone
: The phone number.state_name
: The name for the state.alternative_phone
: The alternative phone number.company
: A company name.Spree::Country
object. It can optionally link to a Spree::State
object, but only in the cases where the related country has no states listed. In that case, the state information is still required, and is kept within the state_name
field on the address record. An easy way to get the state information for the address is to call state_text
on that object.Spree::User
can have multiple addresses and can manage them on the Checkout and Account page. Previously this feature was part of the Spree Address Book extension. Each Spree::Address
object has a user_id
column which links to the User.Spree::User
there is ship_address_id
and bill_address_id
columns which indicates which addresses are the default ones for this User.