Sha256: 5d78b09b37c7b80f8c44b739b23f48686fc0d2d8b83643eff7d8717c81461c1a

Contents?: true

Size: 858 Bytes

Versions: 18

Compression:

Stored size: 858 Bytes

Contents

# frozen_string_literal: true
module Hyrax
  module DataDestroyers
    # Collection types are recreated by the release seed data.  Clear out here to
    # start with a fresh set.
    #
    # @note WARNING: DO NOT USE IN PRODUCTION!  The methods in this class are destructive.
    #   Data can not be recovered.
    #
    class CollectionTypesDestroyer
      class << self
        attr_accessor :logger

        def destroy_data(logger: Logger.new(STDOUT), allow_destruction_in_production: false)
          raise("CollectionTypesDestroyer is not for use in production!") if Rails.env.production? && !allow_destruction_in_production
          @logger = logger

          logger.info("Destroying collection types...")

          Hyrax::CollectionType.destroy_all
          logger.info("   collection types -- DESTROYED")
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

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