Sha256: 3e45799043a99b9929f2d6f553049c90c903e0b12ebdeec2dde1f50295d59b20

Contents?: true

Size: 537 Bytes

Versions: 58

Compression:

Stored size: 537 Bytes

Contents

module Hyrax
  module Actors
    class LeaseActor
      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 lease, then clear the lease date, etc.
      # Saves the lease and the work
      def destroy
        work.lease_visibility! # If the lease has lapsed, update the current visibility.
        work.deactivate_lease!
        work.lease.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/lease_actor.rb
hyrax-2.9.5 app/actors/hyrax/actors/lease_actor.rb
hyrax-2.9.4 app/actors/hyrax/actors/lease_actor.rb
hyrax-2.9.3 app/actors/hyrax/actors/lease_actor.rb
hyrax-2.9.2 app/actors/hyrax/actors/lease_actor.rb
hyrax-2.9.1 app/actors/hyrax/actors/lease_actor.rb
hyrax-2.9.0 app/actors/hyrax/actors/lease_actor.rb
hyrax-2.8.0 app/actors/hyrax/actors/lease_actor.rb
hyrax-2.7.2 app/actors/hyrax/actors/lease_actor.rb
hyrax-2.7.1 app/actors/hyrax/actors/lease_actor.rb
hyrax-2.7.0 app/actors/hyrax/actors/lease_actor.rb
hyrax-2.6.0 app/actors/hyrax/actors/lease_actor.rb
hyrax-3.0.0.pre.rc1 app/actors/hyrax/actors/lease_actor.rb
hyrax-3.0.0.pre.beta3 app/actors/hyrax/actors/lease_actor.rb
hyrax-2.5.1 app/actors/hyrax/actors/lease_actor.rb
hyrax-2.5.0 app/actors/hyrax/actors/lease_actor.rb
hyrax-3.0.0.pre.beta2 app/actors/hyrax/actors/lease_actor.rb
hyrax-2.4.1 app/actors/hyrax/actors/lease_actor.rb
hyrax-3.0.0.pre.beta1 app/actors/hyrax/actors/lease_actor.rb
hyrax-2.4.0 app/actors/hyrax/actors/lease_actor.rb