-
-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Run callbacks on through model when detaching association #3004
Conversation
Code Climate has analyzed commit 14b3980 and detected 1 issue on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
Here team defines it's team_members assoc using a through table however, User defines the same association as a HABTM. Detaching a user from the team show page will call Update: Adrian and I talked about this. user.rb should be declaring the relationship as a through relationship. It's unusual to declare a relationship as a through at one end and a HABTM on the other end. |
d9fda8f
to
e7b26af
Compare
Agree, I also noticed that particularity on our dummy recently. Does this PR work well from both sides if the associations are correctly defined? |
2f60cb4
to
1196118
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! Thanks @binarygit, let's please remove the duplicated association and also solve the conflicts.
Wait. I’m working on displaying the messages when associations are misconfigured |
1cab170
to
7d6d0e9
Compare
e608c8f
to
03b0466
Compare
714e695
to
bd7251a
Compare
@Paul-Bob I couldn't find a straightforward way to check if associations are properly configured. Sorry for holding this up, maybe merge this now and I'll pick this up again later. |
I actually talked about this here: https://rubyonrails-link.slack.com/archives/C05054QPL/p1721928807967489 and I don't think verifying associations are setup correctly should be our job. I did try and it's too much work and also feels like it should be upto the user (like the devs point out in the link) to set it up correctly. WDYT? |
It's ok without the association check @binarygit thanks for looking into it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's looking good, thanks @binarygit!
Description
Fixes #2512
Checklist:
Screenshots & recording
Manual review steps
Manual reviewer: please leave a comment with output from the test if that's the case.