From 47790e7ef12a43c02701c72ca571b6bfdf9bfb3e Mon Sep 17 00:00:00 2001 From: Guillaume Lazzara Date: Mon, 4 Jul 2016 17:47:34 +0200 Subject: [PATCH] Fix previous filename --- lib/tasks/cloud_storage.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/cloud_storage.rake b/lib/tasks/cloud_storage.rake index a41b3d93f..821866129 100644 --- a/lib/tasks/cloud_storage.rake +++ b/lib/tasks/cloud_storage.rake @@ -65,7 +65,7 @@ namespace :cloudstorage do unless content.current_path.nil? if File.exist?(File.dirname(content.current_path) + '/uploaded') previous_filename = File.read(File.dirname(content.current_path) + '/uploaded') - entry.update_column(c == Procedure ? :logo : :content, filename) + entry.update_column(c == Procedure ? :logo : :content, previous_filename) puts "restoring #{content.current_path} db data to #{previous_filename}" FileUtils.rm(File.dirname(content.current_path) + '/uploaded') end