I have a model Group.

A group can have many addresses as locations. It has to have two kinds of other addresses for sure:
one for a mailing address
one for a billing address

So Address is a Model too, how do I have a belongs\_to to the same model but with
multiple ids?

i.e.

Group:
 mailing\_address\_id
 billing\_address\_id

The various locations is taken care of by a group\_locations join table easy enough:
id
group\_id
address\_id

But how do I use the belongs\_to for the mailing\_address\_id and biling\_address\_id ??? normally it would be:

address\_id (like it is in the join) but I need them to *mean* something.

this is an artifact of me wanting to seperate out the addresses into another table trying to keep the database relatively normalized I think it is called.

I also had a heck of a time building another kind of a join table that joins people in a group through the locations join table...but that is a diff topic I posted here:

<https://stackoverflow.com/questions/31599419/building-a-migration-for-a-join-table-based-on-a-join-table-in-rails>