Sha256: 9b562af18df7d04c2e7ca69142e6b73b8059d4b7de9f8e2a366600a454846de3

Contents?: true

Size: 564 Bytes

Versions: 37

Compression:

Stored size: 564 Bytes

Contents

module CurationConcerns
  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

37 entries across 37 versions & 1 rubygems

Version Path
curation_concerns-1.7.8 app/actors/curation_concerns/actors/embargo_actor.rb
curation_concerns-1.7.7 app/actors/curation_concerns/actors/embargo_actor.rb
curation_concerns-2.0.0 app/actors/curation_concerns/actors/embargo_actor.rb
curation_concerns-2.0.0.rc2 app/actors/curation_concerns/actors/embargo_actor.rb
curation_concerns-1.7.6 app/actors/curation_concerns/actors/embargo_actor.rb
curation_concerns-1.7.5 app/actors/curation_concerns/actors/embargo_actor.rb
curation_concerns-1.7.4 app/actors/curation_concerns/actors/embargo_actor.rb
curation_concerns-1.7.3 app/actors/curation_concerns/actors/embargo_actor.rb
curation_concerns-1.7.2 app/actors/curation_concerns/actors/embargo_actor.rb
curation_concerns-2.0.0.rc1 app/actors/curation_concerns/actors/embargo_actor.rb
curation_concerns-1.7.1 app/actors/curation_concerns/actors/embargo_actor.rb
curation_concerns-1.7.0 app/actors/curation_concerns/actors/embargo_actor.rb
curation_concerns-1.7.0.beta1 app/actors/curation_concerns/actors/embargo_actor.rb
curation_concerns-1.6.3 app/actors/curation_concerns/actors/embargo_actor.rb
curation_concerns-1.6.2 app/actors/curation_concerns/actors/embargo_actor.rb
curation_concerns-1.6.1 app/actors/curation_concerns/actors/embargo_actor.rb
curation_concerns-1.6.0 app/actors/curation_concerns/actors/embargo_actor.rb
curation_concerns-1.5.0 app/actors/curation_concerns/actors/embargo_actor.rb
curation_concerns-1.4.0 app/actors/curation_concerns/actors/embargo_actor.rb
curation_concerns-1.3.3 app/actors/curation_concerns/actors/embargo_actor.rb