X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/7599f98957334d1924550205f7ba12a726de7eb0..9d2fed811fd37577bf5cce8e8fe03d2097852428:/app/controllers/trace_controller.rb diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index 4b138bdae..69cd9866e 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -16,8 +16,8 @@ class TraceController < ApplicationController before_filter :offline_redirect, :only => [:create, :edit, :delete, :data, :api_create, :api_delete, :api_data] around_filter :api_call_handle_error, :only => [:api_create, :api_read, :api_update, :api_delete, :api_data] - caches_action :list, :unless => :logged_in?, :layout => false - caches_action :view, :layout => false +# caches_action :list, :unless => :logged_in?, :layout => false +# caches_action :view, :layout => false caches_action :georss, :layout => true cache_sweeper :trace_sweeper, :only => [:create, :edit, :delete, :api_create, :api_update, :api_delete] cache_sweeper :tracetag_sweeper, :only => [:create, :edit, :delete, :api_create, :api_update, :api_delete] @@ -66,13 +66,7 @@ class TraceController < ApplicationController end if params[:tag] - @tag = params[:tag] - - files = Tracetag.where(:tag => params[:tag]).select(:gpx_id).all - - if files.length > 0 - @traces = @traces.where(:id => files.collect { |tt| tt.gpx_id }) - end + @traces = @traces.tagged(params[:tag]) end @page = (params[:page] || 1).to_i @@ -215,14 +209,14 @@ class TraceController < ApplicationController end def georss - traces = Trace.public + traces = Trace.public.visible if params[:display_name] traces = traces.joins(:user).where(:users => {:display_name => params[:display_name]}) end if params[:tag] - traces = traces.where("EXISTS (SELECT * FROM gpx_file_tags AS gft WHERE gft.gpx_id = gpx_files.id AND gft.tag = ?)", params[:tag]) + traces = traces.tagged(params[:tag]) end traces = traces.order("timestamp DESC")