You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't see a point to adding the dependent option in this case. Am I missing something? If I was using a join table, it might be helpful, but that is not the case.
The text was updated successfully, but these errors were encountered:
Users might or might not want to destroy such an association.
Imagine the case of User -> Subscription -> Content. It would be horrible to destroy content when a User is destroyed with their subscriptions.
If the business logic suggests that comments should be destroyed along with users, this should go to User model, and not be part of the association that triggered the destroy of User.
Users might or might not want to destroy such an association.
Imagine the case of User -> Subscription -> Content. It would be horrible to destroy content when a User is destroyed with their subscriptions.
According to Rails' documentation for has_many with :through, the dependent: :destroy option will only destroy the join models. In that case, Content is not deleted. Isn't it?
I'm getting hit with a linting error when I use
has_many
with thethrough
option.A trivial example:
I don't see a point to adding the
dependent
option in this case. Am I missing something? If I was using a join table, it might be helpful, but that is not the case.The text was updated successfully, but these errors were encountered: