Sha256: 4fbce474105c2c19b40866057a655c288eed646ef94d820393516089a14d3081

Contents?: true

Size: 520 Bytes

Versions: 48

Compression:

Stored size: 520 Bytes

Contents

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

48 entries across 48 versions & 1 rubygems

Version Path
hyrax-2.9.6 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-2.9.5 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-2.9.4 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-2.9.3 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-2.9.2 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-2.9.1 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-2.9.0 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-2.8.0 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-2.7.2 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-2.7.1 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-2.7.0 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-2.6.0 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-3.0.0.pre.rc1 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-3.0.0.pre.beta3 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-2.5.1 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-2.5.0 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-3.0.0.pre.beta2 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-2.4.1 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-3.0.0.pre.beta1 app/actors/hyrax/actors/cleanup_trophies_actor.rb
hyrax-2.4.0 app/actors/hyrax/actors/cleanup_trophies_actor.rb