pet-rescue
pet-rescue copied to clipboard
Clicking pet when viewing adoption applications as adopter fosterer leads to unauthorized error
Reproduction steps:
- Log in as an adopter, eg.
[email protected]:123456
- Go to the
Adoption Applications
page - Click on a pet's name.
- See the error message like screenshot below:
Expected behavior:
In theory I have already put in an application to adopt these pets, so I would expect to be directed to a page with information about that pet (either generic information or information on the application I made).
Actual behavior:
I see an error message flash that says "You are not authorized to perform this action."
In the logs, I see a request was sent to GET /alta/adoptable_pets/1
failed the policy check and resulted in a 302 redirect.
I believe because this part of the expression returns false
as the pet does have a match (the current user).