From 535ef43364d88d499786fbce0c0ed4cdb3488d3b Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Fri, 6 Mar 2015 00:38:45 +0300 Subject: [PATCH] Fixed: NotImplementedError #sha1_of_file_store_files --- app/models/concerns/file_store_clean.rb | 39 +++++++++++++------------ 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/app/models/concerns/file_store_clean.rb b/app/models/concerns/file_store_clean.rb index 6a2f2ed08..f7e137f42 100644 --- a/app/models/concerns/file_store_clean.rb +++ b/app/models/concerns/file_store_clean.rb @@ -2,27 +2,28 @@ module FileStoreClean extend ActiveSupport::Concern included do - def destroy - destroy_files_from_file_store if Rails.env.production? - super - end later :destroy, queue: :middle - - def sha1_of_file_store_files - raise NotImplementedError, "You should implement this method" - end - - def destroy_files_from_file_store(args = sha1_of_file_store_files) - files = *args - files.each do |sha1| - FileStoreService::File.new(sha1: sha1).destroy - end - end - - def later_destroy_files_from_file_store(args) - destroy_files_from_file_store(args) - end later :later_destroy_files_from_file_store, queue: :middle end + def destroy + destroy_files_from_file_store if Rails.env.production? + super + end + + def sha1_of_file_store_files + raise NotImplementedError, "You should implement this method" + end + + def destroy_files_from_file_store(args = sha1_of_file_store_files) + files = *args + files.each do |sha1| + FileStoreService::File.new(sha1: sha1).destroy + end + end + + def later_destroy_files_from_file_store(args) + destroy_files_from_file_store(args) + end + end