[openstreetmap/openstreetmap-website] Use `where()` instead of `find()` to prevent RecordNotFound (PR #4203)

ENT8R notifications at github.com
Sat Aug 26 09:14:40 UTC 2023


I decided to keep it as is (return 200 with empty response/root element) and modified the tests accordingly. I also had to sort the results by their ids because otherwise tests like the following which expect the result to be in a certain order were failing as `where()` does not sort the results by default:
https://github.com/openstreetmap/openstreetmap-website/blob/6759130cb3e266d63743fdf02978550f45eb7c4b/test/controllers/api/users_controller_test.rb#L411-L420

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4203#issuecomment-1694238557
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/4203/c1694238557 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20230826/8f004a0e/attachment.htm>


More information about the rails-dev mailing list