Or: "What happens if you decide wrong"
Doc says:
You should use has_many :through if you need validations, callbacks, or extra attributes on the join model.
But should the "you should use" be a "you must use"?
The point is, we have one attribute in a join table, and this one is heavily discussed.
So what happens if I (we) decide to use the simpler HABTM and in one year the friendly attribute pops up? Is it possible to access it (more complex, ok), or have we go back to start and redesign?
All the answers (and there are a lot of) to this - "HABTM or :through", are more or less easy to decide; "take this or the other".
I want to know how to correct the error if we decide wrong.
Is it eg. possible to "push a model between", or how to access this one attribute, if it pops up?
Or is the better strategy to start with :through? just for sure
Aucun commentaire:
Enregistrer un commentaire