The DRY ideal in this case would be more about describing the relationship only once, and having that relationship then propagate everywhere it needs to, most especially to the foreign keys in your database schema.
Sometimes, reaching that ideal is not practical and in the name of pragmatism a programmer will indeed repeat themselves. But that repetition is where the trouble starts. If you have to describe a relationship twice, then sooner or later someone is going to forget to update one place or the other. As a database guy, you would like them to always remember to update the place that tells the database about that relationship. But in reality, it may be just as likely that someone will update the model and forget to update the database.
The idea with DRY is that you should try very hard to find a way to represent the relationship only once so that mistakes can't happen, but that doesn't mean sacrificing the integrity of your data to do so.
That said, I know little about Rails, and perhaps it's hard to do it right, or at least easy to do it wrong.
Sometimes, reaching that ideal is not practical and in the name of pragmatism a programmer will indeed repeat themselves. But that repetition is where the trouble starts. If you have to describe a relationship twice, then sooner or later someone is going to forget to update one place or the other. As a database guy, you would like them to always remember to update the place that tells the database about that relationship. But in reality, it may be just as likely that someone will update the model and forget to update the database.
The idea with DRY is that you should try very hard to find a way to represent the relationship only once so that mistakes can't happen, but that doesn't mean sacrificing the integrity of your data to do so.
That said, I know little about Rails, and perhaps it's hard to do it right, or at least easy to do it wrong.