Revert r11194 as it doesn't work as the trace_name member does return
authorTom Hughes <tom@compton.nu>
Tue, 21 Oct 2008 12:16:12 +0000 (12:16 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 21 Oct 2008 12:16:12 +0000 (12:16 +0000)
the correct result until after the trace is saved.

app/controllers/trace_controller.rb

index f0e1fe7cc3881cbc9295a92ffc61b9036124210c..899df05dfc021d1d683012bfbb8b995f42579d04 100644 (file)
@@ -306,9 +306,10 @@ private
     @trace.user = @user
     @trace.timestamp = Time.now
 
-    FileUtils.mv(filename, @trace.trace_name)
-    unless @trace.save
-      FileUtils.rm_f(@trace.trace_name)
+    if @trace.save
+      FileUtils.mv(filename, @trace.trace_name)
+    else
+      FileUtils.rm_f(filename)
     end
   end