Sha256: 8e9ccf5e6a05836d729533b9e6485710a60d74a6c11217d4ea51cea1c9bca9a9
Contents?: true
Size: 921 Bytes
Versions: 19
Compression:
Stored size: 921 Bytes
Contents
# frozen_string_literal: true module Hyrax module DataDestroyers # Featured works are tightly coupled to works in the repository. When they # are removed using wipe!, the associated database entries for featured # works also need to be deleted. # # @note WARNING: DO NOT USE IN PRODUCTION! The methods in this class are destructive. # Data can not be recovered. # class FeaturedWorksDestroyer class << self attr_accessor :logger def destroy_data(logger: Logger.new(STDOUT), allow_destruction_in_production: false) raise("FeaturedWorksDestroyer is not for use in production!") if Rails.env.production? && !allow_destruction_in_production @logger = logger logger.info("Destroying featured works...") FeaturedWork.destroy_all logger.info(" featured works -- DESTROYED") end end end end end
Version data entries
19 entries across 19 versions & 1 rubygems