Sha256: b0b96b78a65f53b6c8e91eea5c9949d1855d891def98028af3ef5c933e57422a

Contents?: true

Size: 583 Bytes

Versions: 13

Compression:

Stored size: 583 Bytes

Contents

# frozen_string_literal: true
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

13 entries across 13 versions & 1 rubygems

Version Path
hyrax-3.4.2 app/actors/hyrax/actors/embargo_actor.rb
hyrax-4.0.0.beta1 app/actors/hyrax/actors/embargo_actor.rb
hyrax-3.4.1 app/actors/hyrax/actors/embargo_actor.rb
hyrax-3.4.0 app/actors/hyrax/actors/embargo_actor.rb
hyrax-3.3.0 app/actors/hyrax/actors/embargo_actor.rb
hyrax-3.2.0 app/actors/hyrax/actors/embargo_actor.rb
hyrax-3.1.0 app/actors/hyrax/actors/embargo_actor.rb
hyrax-3.0.2 app/actors/hyrax/actors/embargo_actor.rb
hyrax-3.0.1 app/actors/hyrax/actors/embargo_actor.rb
hyrax-3.0.0 app/actors/hyrax/actors/embargo_actor.rb
hyrax-3.0.0.pre.rc4 app/actors/hyrax/actors/embargo_actor.rb
hyrax-3.0.0.pre.rc3 app/actors/hyrax/actors/embargo_actor.rb
hyrax-3.0.0.pre.rc2 app/actors/hyrax/actors/embargo_actor.rb