]> git.openstreetmap.org Git - rails.git/commitdiff
Disambiguate ID queries for tagged trace lists
authorTom Hughes <tom@compton.nu>
Thu, 27 Jul 2023 19:29:29 +0000 (20:29 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 27 Jul 2023 19:29:29 +0000 (20:29 +0100)
app/controllers/traces_controller.rb

index 4f263e9b27b3ed0ed8fcd9359d5c583dc0be6db5..0b7dbc94a60228f0e63656333a689b5abef24ec4 100644 (file)
@@ -59,9 +59,9 @@ class TracesController < ApplicationController
     @params = params.permit(:display_name, :tag, :before, :after)
 
     @traces = if params[:before]
-                traces.where("id < ?", params[:before]).order(:id => :desc)
+                traces.where("gpx_files.id < ?", params[:before]).order(:id => :desc)
               elsif params[:after]
-                traces.where("id > ?", params[:after]).order(:id => :asc)
+                traces.where("gpx_files.id > ?", params[:after]).order(:id => :asc)
               else
                 traces.order(:id => :desc)
               end