search for: shipping_address_id

Displaying 5 results from an estimated 5 matches for "shipping_address_id".

2006 Apr 04
4
Aggregating two objects of the same type
I would like to have a customer that has references to two addresses, a billing address and a shipping address. In a non-rails environment I would have two keys in the customers table, billing_address_id and shipping_address_id to reference the addresses. It appears that ActiveRecord expects the parent id to reside in the child table, regardless of whether the relationship is one-to-one or one-to-many. What would the best approach be to persist this type of data structure? I would prefer to avoid a one-to-many relatio...
2006 Nov 04
0
Check_box woes
I have a User model and an Address model. A user has_many addresses, and an address belongs_to a user. An address object for a user could be a billing, shipping or marketing address. The way I''m tracking this is via the user attributes: billing_adress_id, marketing_address_id and shipping_address_id in the user table, which holds the relevant address id. But in my form that allows a user to edit an address, including nominating it as a marketing, shipping or billing address, I''m getting stuck with the check_box helpers setting this up. Here''s my form (edit_address.rhtml --...
2006 Apr 08
2
one-to-one relationship confusion
...objects in a similar way, so I would really like to avoid putting the keys referencing the customer or other objects in the addresses table. Addresses are exclusively referenced by parent objects and a many-to-many association is not appropriate. Ideally I would like the customers table to use a shipping_address_id and a billing_address_id to reference the aggregate addresses. For illustration purposes, another object, company might have a main_address_id, an after_hours_address_id and a weekend_address_id. In order to keep the keys in the customer table the belongs_to statements are in the customer model a...
2006 Jun 03
8
confused about ActiveRecord relationships
I am very confused about where to put the belongs_to and the has_one (and other relationship identifiers). I have read the RDoc and the agile book many times about this and I think i still see it backwards. Let me outline my app so you have an understanding... I have 2 tables: Schools { id, school_name, address_id } and Addresses { street1, street2, city, state, zip, country } *** this
2006 Aug 02
3
Data relationships for e-commerce: users, orders, addresses
Hi there I''m in the process of developing an e-commerce Rails app but am getting a little stuck on what models I should be working with on the order/checkout side of things. The app requires users to be registered and authenticated to checkout. So I already have a User model and an Order model (which belongs to a User). The Order model is largely similar to that used in the Agile Rails