Allow case_assignments to be unassigned#343
Conversation
compwron
left a comment
There was a problem hiding this comment.
This looks like a good step forward! 💖
I hope that eventually we will add a /features test for this functionality but it will be easier as part of / after https://github.com/rubyforgood/casa/pull/344/files :)
| </td> | ||
| <td> | ||
| <% if assignment.is_active? %> | ||
| <% if assignment.is_active? && current_user.role == "casa_admin" || assignment.volunteer.supervisor == current_user %> |
There was a problem hiding this comment.
volunteer.supervisor should be volunteer&.supervisor because not all volunteers will have supervisors
There was a problem hiding this comment.
@compwron i'm pretty sure that the & in this case is only verifying that the volunteer is present, so if the volunteer doesn't have a supervisor volunteer.supervisor will be nil
There was a problem hiding this comment.
pretty sure the & would be needed if not all assignments have volunteers (but the assignment has a belongs_to that validates volunteer is present)
What github issue is this PR for, if any?
Resolves #20 (Also related to number 230)
What changed, and why?
Notes
How will this affect user permissions?
How is this tested? (please write tests!) 💖💪
Help, please!
Screenshots please :)