Sha256: cfe1bc78ec5790425ae1592208b7d325094ca376891394972f6433ca17cd8865
Contents?: true
Size: 1.05 KB
Versions: 15
Compression:
Stored size: 1.05 KB
Contents
# frozen_string_literal: true module Hyrax module DataDestroyers # Collection branding info is tightly coupled to collections. When they are # removed using wipe!, the associated database entries for collection branding # also have to be deleted. # # @note WARNING: DO NOT USE IN PRODUCTION! The methods in this class are destructive. # Data can not be recovered. # # @todo This destroys branding info in the database. Should it also delete # related banner and logo files? class CollectionBrandingDestroyer class << self attr_accessor :logger def destroy_data(logger: Logger.new(STDOUT), allow_destruction_in_production: false) raise("CollectionBrandingDestroyer is not for use in production!") if Rails.env.production? && !allow_destruction_in_production @logger = logger logger.info("Destroying collection branding...") Hyrax::CollectionBrandingInfo.destroy_all logger.info(" collection branding -- DESTROYED") end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems