]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/api/traces_controller.rb
Refactor user controller tests
[rails.git] / app / controllers / api / traces_controller.rb
index fd43a1d44500681ee874c8faf15e2bfe07aef6c4..8979704a71802167af2b374ea8f173259bd36215 100644 (file)
@@ -16,14 +16,9 @@ module Api
     around_action :api_call_handle_error
 
     def show
-      trace = Trace.visible.find(params[:id])
+      @trace = Trace.visible.find(params[:id])
 
-      if trace.public? || trace.user == current_user
-        @traces = [trace]
-        render "trace"
-      else
-        head :forbidden
-      end
+      head :forbidden unless @trace.public? || @trace.user == current_user
     end
 
     def update