diff --git a/app/models/fluentd/setting_archive/backup_file.rb b/app/models/fluentd/setting_archive/backup_file.rb index f0c310c..b2d2f61 100644 --- a/app/models/fluentd/setting_archive/backup_file.rb +++ b/app/models/fluentd/setting_archive/backup_file.rb @@ -13,7 +13,7 @@ class Fluentd def initialize(file_path, note = nil) @file_path = file_path - @note = note || Note.new(file_path.sub(/#{FILE_EXTENSION}$/, Note::FILE_EXTENSION)) + @note = note || Note.create(file_path.sub(/#{FILE_EXTENSION}$/, Note::FILE_EXTENSION)) end end end diff --git a/app/models/fluentd/setting_archive/note.rb b/app/models/fluentd/setting_archive/note.rb index 0cc12b2..4aee755 100644 --- a/app/models/fluentd/setting_archive/note.rb +++ b/app/models/fluentd/setting_archive/note.rb @@ -9,6 +9,11 @@ class Fluentd new(file_path_of(backup_dir, file_id)) end + def self.create(file_path) + FileUtils.touch(file_path) + new(file_path) + end + def initialize(file_path) @file_path = file_path end