]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/traces_controller.rb
Move user lookup and error render to concerns
[rails.git] / app / controllers / traces_controller.rb
index 4f263e9b27b3ed0ed8fcd9359d5c583dc0be6db5..90ab34a48c406d27ecc31b3418c6ad48d94bb4c1 100644 (file)
@@ -1,4 +1,6 @@
 class TracesController < ApplicationController
+  include UserMethods
+
   layout "site", :except => :georss
 
   before_action :authorize_web
@@ -59,9 +61,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