]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/trace_controller.rb
Fix rubocop style issues
[rails.git] / app / controllers / trace_controller.rb
index 251c92a684bc4f36e8703aa723c753c3c0994270..538cf10d242b576d2a5a5e76e9e25b5762674654 100644 (file)
@@ -59,9 +59,7 @@ class TraceController < ApplicationController
       end
     end
 
-    if params[:tag]
-      @traces = @traces.tagged(params[:tag])
-    end
+    @traces = @traces.tagged(params[:tag]) if params[:tag]
 
     @page = (params[:page] || 1).to_i
     @page_size = 20
@@ -212,10 +210,7 @@ class TraceController < ApplicationController
       @traces = @traces.joins(:user).where(:users => { :display_name => params[:display_name] })
     end
 
-    if params[:tag]
-      @traces = @traces.tagged(params[:tag])
-    end
-
+    @traces = @traces.tagged(params[:tag]) if params[:tag]
     @traces = @traces.order("timestamp DESC")
     @traces = @traces.limit(20)
     @traces = @traces.includes(:user)
@@ -372,7 +367,7 @@ class TraceController < ApplicationController
 
         # Rename the temporary file to the final name
         FileUtils.mv(filename, @trace.trace_name)
-      rescue Exception => ex
+      rescue StandardError
         # Remove the file as we have failed to update the database
         FileUtils.rm_f(filename)
 
@@ -384,7 +379,7 @@ class TraceController < ApplicationController
         # Clear the inserted flag to make the import daemon load the trace
         @trace.inserted = false
         @trace.save!
-      rescue Exception => ex
+      rescue StandardError
         # Remove the file as we have failed to update the database
         FileUtils.rm_f(@trace.trace_name)