Sha256: c8aa157c0eb3c1ee1944c8c37df3eeb3f93c649ca163b2f507545e846b9f2bed

Contents?: true

Size: 544 Bytes

Versions: 29

Compression:

Stored size: 544 Bytes

Contents

# frozen_string_literal: true

module Hyrax
  module Actors
    # Responsible for removing trophies related to the given curation concern.
    class CleanupTrophiesActor < Hyrax::Actors::AbstractActor
      # @param [Hyrax::Actors::Environment] env
      # @return [Boolean] true if destroy was successful
      def destroy(env)
        cleanup_trophies(env)
        next_actor.destroy(env)
      end

      private

      def cleanup_trophies(env)
        Trophy.where(work_id: env.curation_concern.id).destroy_all
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
hyrax-5.1.0.pre.beta1 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-5.0.4 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-5.0.3 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-5.0.2 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-5.0.1 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-5.0.0 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-5.0.0.rc3 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-5.0.0.rc2 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-5.0.0.rc1 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-3.6.0 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-4.0.0 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-4.0.0.rc3 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-4.0.0.rc2 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-4.0.0.rc1 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-3.5.0 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-4.0.0.beta2 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-3.4.2 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-4.0.0.beta1 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-3.4.1 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-3.4.0 app/actors/hyrax/actors/cleanup_trophies_actor.rb