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
Volunteer shown as actively assigned to two supervisors after being re-assigned #797
Comments
I believe this was introduced with #765 |
Oh noooo not again |
@cliftonmcintosh just wanted to express my gratitude for all the detail you provided in this issue – I didn't need to add anything! Thank you for making this clear and easy for a contributor to pick up. |
I'll give this one a try. Perfect PR description 👌🏼 |
One thing to note is that the volunteers to supervisors relationship is many to one right now. It seems to me that if there are two records for a volunteer in the https://github.com/rubyforgood/casa/blob/master/app/models/user.rb#L18-L24 But I could be wrong |
Correct, one volunteer can only be actively assigned to one supervisor at a time. We also need to keep a record of a volunteer having previously been assigned to different supervisor. Is that many-to-many? Kind of? Whatever works 😅 |
Thanks for the info @cliftonmcintosh, @compwron, I see what the problem is. I'll be working on a fix and some specs to cover that scenario. |
@cliftonmcintosh, @compwron I believe the PR above addresses the issue. Let me know if there's anything there you'd like changed, I'm aiming to merge it at some point this afternoon. |
…visors-after-re-assign [#797] volunteer with two supervisors after re assign
Expected Behavior
When a volunteer has been unassigned from a supervisor, that volunteer's listing with that supervisor should have the text "Unassigned" in the "Assign" column even after that volunteer has been assigned to a new supervisor.
Actual Behavior
When a volunteer has been unassigned from a supervisor and then the volunteer has been assigned to a new supervisor, the list of volunteers for the old supervisor has the "Unassign" button visible for the volunteer.
Steps to reproduce
Screenshots and data
In this example, Lincoln Huels was unassigned from Craig Blick and then assigned to Mrs. Jarrett Dicki. Note the "is_active" flag for Lincoln's records. However, Lincoln no longer has the "Unassigned" text in the listing of Craig Blick's volunteers.
Database records
Mrs. Jarrett Dicki (supervisor 101), the volunteer's current supervisor, correctly has the "Unassign" button visible for Lincoln Huels
Craig Blick (supervisor 102), the volunteer's previous supervisor, incorrectly has the "Unassign" button visible for Lincoln Huels
The text was updated successfully, but these errors were encountered: