Skip to content
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

Fix bug with looking up Homeroom when ambiguous param given #2022

Merged
merged 1 commit into from Aug 27, 2018

Conversation

kevinrobinson
Copy link
Contributor

Who is this PR for?

educators

What problem does this PR fix?

When linking to a homeroom by id (eg, from the profile page), the page doesn't load. This is because the lookup process with Homeroom.friendly.find(id_or_slug) doesn't match as expected with the string version of an id. As a guess, it looks first on the name field and so if any homeroom name matches the string version of an id, it will match that first rather than matching by id. Alternately, perhaps it's doing a stricter lookup than Homeroom.find and failing to match on a string version of the id, the way that #find would.

What does this PR do?

Fixes it by making explicit the lookup order, and removing the use of friendly to make queries.

@kevinrobinson
Copy link
Contributor Author

selfie

@kevinrobinson kevinrobinson merged commit 65484d9 into master Aug 27, 2018
@kevinrobinson kevinrobinson deleted the patch/homerooms-controller-find branch August 27, 2018 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant