Sha256: 760c9889420618f089e7aa5294c999e390967209e4a5eee9162b0bb754ef39d3

Contents?: true

Size: 553 Bytes

Versions: 58

Compression:

Stored size: 553 Bytes

Contents

module Hyrax
  module Actors
    class EmbargoActor
      attr_reader :work

      # @param [Hydra::Works::Work] work
      def initialize(work)
        @work = work
      end

      # Update the visibility of the work to match the correct state of the embargo, then clear the embargo date, etc.
      # Saves the embargo and the work
      def destroy
        work.embargo_visibility! # If the embargo has lapsed, update the current visibility.
        work.deactivate_embargo!
        work.embargo.save!
        work.save!
      end
    end
  end
end

Version data entries

58 entries across 58 versions & 2 rubygems

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