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

[Backport] Use find instead of find_by_id #3234

Merged
merged 4 commits into from
Jan 30, 2019

Conversation

microweb10
Copy link
Member

@microweb10 microweb10 commented Jan 25, 2019

References

AyuntamientoMadrid#1831

Objectives

  • Use correct param in controller
  • Remove unused before_action
  • Use find instead of find_by_id
  • Add method find_by_slug_or_id to Sluggable module

This method will raise an exception if resource is not found when
trying to call score_action on nil.
Prefer to raise a 404 HTML NotFound error instead.
Make it easier to find by slug or id for sluggable models. Will return
nil if resource is not found.
@microweb10 microweb10 force-pushed the use_find_instead_of_find_by_id branch from 1173e23 to 3bf2fa1 Compare January 29, 2019 16:34
@microweb10 microweb10 self-assigned this Jan 30, 2019
@microweb10 microweb10 added this to Release 0.19 in Roadmap Jan 30, 2019
@microweb10 microweb10 merged commit 0e9fd64 into master Jan 30, 2019
@microweb10 microweb10 deleted the use_find_instead_of_find_by_id branch January 30, 2019 18:46
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

2 participants