addresslogic icon indicating copy to clipboard operation
addresslogic copied to clipboard

multiple addresses on same order

Open bpokosh opened this issue 16 years ago • 1 comments

Could this be used for multiple addresses on the same model? For example, a billing address and shipping address.

bpokosh avatar Oct 08 '09 20:10 bpokosh

You couldn't do so as it stands, but it's certainly possible to write your own apply_address_logic and a wrapper around address_parts which would allow you to do what you want.

However, having all the separate fields for a billing address and a shipping address in the same table might be a bit of a db-smell. If there were an addresses table into which your model had a billing foreign key and a shipping foreign key, then you could certainly call model.shipping_address.address_parts and model.billing_address.address_parts. Then you'd only need to apply_address_logic the one time, in the Address model.

tsnow avatar May 25 '11 22:05 tsnow