Class: Hyrax::Actors::LeaseActor
- Inherits:
-
Object
- Object
- Hyrax::Actors::LeaseActor
- Defined in:
- app/actors/hyrax/actors/lease_actor.rb
Instance Attribute Summary collapse
-
#work ⇒ Object
readonly
Returns the value of attribute work.
Instance Method Summary collapse
-
#destroy ⇒ Object
Update the visibility of the work to match the correct state of the lease, then clear the lease date, etc.
-
#initialize(work) ⇒ LeaseActor
constructor
A new instance of LeaseActor.
Constructor Details
#initialize(work) ⇒ LeaseActor
Returns a new instance of LeaseActor.
7 8 9 |
# File 'app/actors/hyrax/actors/lease_actor.rb', line 7 def initialize(work) @work = work end |
Instance Attribute Details
#work ⇒ Object (readonly)
Returns the value of attribute work.
4 5 6 |
# File 'app/actors/hyrax/actors/lease_actor.rb', line 4 def work @work end |
Instance Method Details
#destroy ⇒ Object
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
13 14 15 16 17 18 |
# File 'app/actors/hyrax/actors/lease_actor.rb', line 13 def destroy work.lease_visibility! # If the lease has lapsed, update the current visibility. work.deactivate_lease! work.lease.save! work.save! end |