Class: Hyrax::LeaseService
- Inherits:
-
RestrictionService
- Object
- RestrictionService
- Hyrax::LeaseService
- Defined in:
- app/services/hyrax/lease_service.rb
Class Method Summary collapse
-
.assets_under_lease ⇒ Object
Returns all assets with lease expiration date set (assumes that when lease visibility is applied to assets whose leases have expired, the lease expiration date will be removed from its metadata).
-
.assets_with_deactivated_leases ⇒ Object
Returns all assets that have had embargoes deactivated in the past.
-
.assets_with_expired_leases ⇒ Object
Returns all assets with lease expiration date set to a date in the past.
Class Method Details
.assets_under_lease ⇒ Object
Returns all assets with lease expiration date set
(assumes that when lease visibility is applied to assets
whose leases have expired, the lease expiration date will be removed from its metadata)
14 15 16 17 |
# File 'app/services/hyrax/lease_service.rb', line 14 def assets_under_lease builder = Hyrax::LeaseSearchBuilder.new(self) presenters(builder) end |
.assets_with_deactivated_leases ⇒ Object
Returns all assets that have had embargoes deactivated in the past.
20 21 22 23 |
# File 'app/services/hyrax/lease_service.rb', line 20 def assets_with_deactivated_leases builder = Hyrax::DeactivatedLeaseSearchBuilder.new(self) presenters(builder) end |
.assets_with_expired_leases ⇒ Object
Returns all assets with lease expiration date set to a date in the past
5 6 7 8 9 |
# File 'app/services/hyrax/lease_service.rb', line 5 def assets_with_expired_leases # ActiveFedora::Base.where('lease_expiration_date_dtsi:[* TO NOW]') builder = Hyrax::ExpiredLeaseSearchBuilder.new(self) presenters(builder) end |