samedi 27 mai 2017

Has_one through AND has_many through together

Hello i have 3 models:

  • Sale
  • Customer
  • Customer Address

-Each SALE should have only one CUSTOMER

-Each CUSTOMER can have more than one SALE

That works great, there's no problem here, but now i need something like this:

-Each SALE should have only one CUSTOMER_ADDRESS

-Each CUSTOMER can have more than one CUSTOMER_ADDRESS


And then, how can i do this?

Can i use has_one through and has_many through together?

Aucun commentaire:

Enregistrer un commentaire