@@ -2,4 +2,8 @@ class BackupService
|
||||
def backup(file_path, options = {})
|
||||
raise NotImplementedError.new("#{self.class}.backup not implemented")
|
||||
end
|
||||
|
||||
def delete(file_path, options = {})
|
||||
raise NotImplementedError.new("#{self.class}.delete not implemented")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2,4 +2,8 @@ class NullBackupService
|
||||
def backup(file_path, options = {})
|
||||
# do nothing
|
||||
end
|
||||
|
||||
def delete(file_path, options = {})
|
||||
# do nothing
|
||||
end
|
||||
end
|
||||
|
||||
@@ -74,6 +74,7 @@ class Post < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
backup_service = Danbooru.config.backup_service
|
||||
backup_service.delete(file_path, type: :original)
|
||||
backup_service.delete(large_file_path, type: :large)
|
||||
backup_service.delete(preview_file_path, type: :preview)
|
||||
|
||||
Reference in New Issue
Block a user