]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/api/traces_controller.rb
Fix numericality validation to use correct integer only constraint
[rails.git] / app / controllers / api / traces_controller.rb
index 86f1370f64d8e1d7198c3bb64e17ba7a6c13f24e..8979704a71802167af2b374ea8f173259bd36215 100644 (file)
@@ -16,13 +16,9 @@ module Api
     around_action :api_call_handle_error
 
     def show
     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
-        render :xml => trace.to_xml.to_s
-      else
-        head :forbidden
-      end
+      head :forbidden unless @trace.public? || @trace.user == current_user
     end
 
     def update
     end
 
     def update