Patching better 412 error messages from mis-commit on old api06 branch.
[rails.git] / app / controllers / trace_controller.rb
index cabbb4ff90f916763b3f48cf7a76da9b22453151..e6c732d2d3b760c29fbb48e4e685a32db37a56f0 100644 (file)
@@ -57,7 +57,12 @@ class TraceController < ApplicationController
       @tag = params[:tag]
 
       files = Tracetag.find_all_by_tag(params[:tag]).collect { |tt| tt.gpx_id }
-      conditions[0] += " AND gpx_files.id IN (#{files.join(',')})"
+
+      if files.length > 0
+        conditions[0] += " AND gpx_files.id IN (#{files.join(',')})"
+      else
+        conditions[0] += " AND 0 = 1"
+      end
     end
     
     conditions[0] += " AND gpx_files.visible = ?"