multiple addresses on same order #1

Open
bpokosh opened this Issue Oct 8, 2009 · 1 comment

Projects

None yet

2 participants

@bpokosh
bpokosh commented Oct 8, 2009

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

@tsnow
tsnow commented May 25, 2011

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment