From: Tom Hughes Date: Thu, 27 Jul 2023 19:29:29 +0000 (+0100) Subject: Disambiguate ID queries for tagged trace lists X-Git-Tag: live~1507 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/edfe0dde677a35a915858512a03bb972e57ee4b4 Disambiguate ID queries for tagged trace lists --- diff --git a/app/controllers/traces_controller.rb b/app/controllers/traces_controller.rb index 4f263e9b2..0b7dbc94a 100644 --- a/app/controllers/traces_controller.rb +++ b/app/controllers/traces_controller.rb @@ -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