]> git.openstreetmap.org Git - rails.git/commitdiff
Prefer find_by() instead of where().first
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 4 Oct 2023 16:53:58 +0000 (17:53 +0100)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 4 Oct 2023 16:53:58 +0000 (17:53 +0100)
These are very similar, differing only if we would expect multiple
results and the sorting is important. However, in all our cases
we're only expecting one result to be returned, and so find_by is
easier to read.


No differences found