Safecast / safecastapi

The app that powers api.safecast.org
44 stars 25 forks source link

Fix error in mesurements#index when only `distance` is specified #928

Closed eitoball closed 2 years ago

eitoball commented 2 years ago

Errors like the following were recorded in New Relic:

undefined local variable or method `scoped' for #<Class:0x000000000b0c6448> Did you mean? scope unscoped
    //var/app/current/app/models/measurement:rb:27:in `nearby_to'

scoped class method has been deprecated since Rails 5. There was deprecation warning like:

DEPRECATION WARNING: Model.scoped is deprecated. Please use Model.all instead.

But, we missed it when upgrading to Rails 5.