]> git.openstreetmap.org Git - rails.git/blob - app/controllers/traces/feeds_controller.rb
Merge remote-tracking branch 'upstream/pull/5517'
[rails.git] / app / controllers / traces / feeds_controller.rb
1 module Traces
2   class FeedsController < ApplicationController
3     before_action :authorize_web
4     before_action :set_locale
5     before_action :check_database_readable
6
7     authorize_resource :class => Trace
8
9     def show
10       @traces = Trace.visible_to_all.visible
11
12       @traces = @traces.joins(:user).where(:users => { :display_name => params[:display_name] }) if params[:display_name]
13
14       @traces = @traces.tagged(params[:tag]) if params[:tag]
15       @traces = @traces.order("timestamp DESC")
16       @traces = @traces.limit(20)
17       @traces = @traces.includes(:user)
18     end
19   end
20 end