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

Version Path
hyrax-5.0.1 app/utils/hyrax/data_destroyers/collection_branding_destroyer.rb
hyrax-5.0.0 app/utils/hyrax/data_destroyers/collection_branding_destroyer.rb
hyrax-5.0.0.rc3 app/utils/hyrax/data_destroyers/collection_branding_destroyer.rb
hyrax-5.0.0.rc2 app/utils/hyrax/data_destroyers/collection_branding_destroyer.rb
hyrax-5.0.0.rc1 app/utils/hyrax/data_destroyers/collection_branding_destroyer.rb
hyrax-3.6.0 app/utils/hyrax/data_destroyers/collection_branding_destroyer.rb
hyrax-4.0.0 app/utils/hyrax/data_destroyers/collection_branding_destroyer.rb
hyrax-4.0.0.rc3 app/utils/hyrax/data_destroyers/collection_branding_destroyer.rb
hyrax-4.0.0.rc2 app/utils/hyrax/data_destroyers/collection_branding_destroyer.rb
hyrax-4.0.0.rc1 app/utils/hyrax/data_destroyers/collection_branding_destroyer.rb
hyrax-3.5.0 app/utils/hyrax/data_destroyers/collection_branding_destroyer.rb
hyrax-4.0.0.beta2 app/utils/hyrax/data_destroyers/collection_branding_destroyer.rb
hyrax-3.4.2 app/utils/hyrax/data_destroyers/collection_branding_destroyer.rb
hyrax-4.0.0.beta1 app/utils/hyrax/data_destroyers/collection_branding_destroyer.rb
hyrax-3.4.1 app/utils/hyrax/data_destroyers/collection_branding_destroyer.rb