[openstreetmap/openstreetmap-website] Sort and order notes (#2381)

ENT8R notifications at github.com
Wed Feb 19 11:59:49 UTC 2020


ENT8R commented on this pull request.



> @@ -294,11 +294,25 @@ def search
           raise OSM::APIBadUserInput, "Date #{params[:to]} is in a wrong format"
         end
 
-        @notes = @notes.where(:created_at => from..to)
+        @notes = params[:sort] == "created_at" ? @notes.where(:created_at => from..to) : @notes.where(:updated_at => from..to)

You're right. I didn't notice that one...

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/2381#discussion_r381247607
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20200219/eab23bff/attachment.htm>


More information about the rails-dev mailing list