From: Tom Hughes Date: Tue, 21 Oct 2008 12:16:12 +0000 (+0000) Subject: Revert r11194 as it doesn't work as the trace_name member does return X-Git-Tag: live~7666 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/fb997c0a7643538be6b2f3effa65b57e76225cc9?ds=sidebyside Revert r11194 as it doesn't work as the trace_name member does return the correct result until after the trace is saved. --- diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index f0e1fe7cc..899df05df 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -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