Sha256: a49f4548f5e74b11cc8ea4ab27f6fe8d580cb54c207ced39654068e22c85acac

Contents?: true

Size: 1.01 KB

Versions: 58

Compression:

Stored size: 1.01 KB

Contents

module Hyrax
  class LeaseService < RestrictionService
    class << self
      # Returns all assets with lease expiration date set to a date in the past
      def assets_with_expired_leases
        # ActiveFedora::Base.where('lease_expiration_date_dtsi:[* TO NOW]')
        builder = Hyrax::ExpiredLeaseSearchBuilder.new(self)
        presenters(builder)
      end

      # 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)
      def assets_under_lease
        builder = Hyrax::LeaseSearchBuilder.new(self)
        presenters(builder)
      end

      # Returns all assets that have had embargoes deactivated in the past.
      def assets_with_deactivated_leases
        builder = Hyrax::DeactivatedLeaseSearchBuilder.new(self)
        presenters(builder)
      end

      private

        def presenter_class
          Hyrax::LeasePresenter
        end
    end
  end
end

Version data entries

58 entries across 58 versions & 2 rubygems

Version Path
hyrax-2.9.6 app/services/hyrax/lease_service.rb
hyrax-2.9.5 app/services/hyrax/lease_service.rb
hyrax-2.9.4 app/services/hyrax/lease_service.rb
hyrax-2.9.3 app/services/hyrax/lease_service.rb
hyrax-2.9.2 app/services/hyrax/lease_service.rb
hyrax-2.9.1 app/services/hyrax/lease_service.rb
hyrax-2.9.0 app/services/hyrax/lease_service.rb
hyrax-2.8.0 app/services/hyrax/lease_service.rb
hyrax-2.7.2 app/services/hyrax/lease_service.rb
hyrax-2.7.1 app/services/hyrax/lease_service.rb
hyrax-2.7.0 app/services/hyrax/lease_service.rb
hyrax-2.6.0 app/services/hyrax/lease_service.rb
hyrax-3.0.0.pre.rc1 app/services/hyrax/lease_service.rb
hyrax-3.0.0.pre.beta3 app/services/hyrax/lease_service.rb
hyrax-2.5.1 app/services/hyrax/lease_service.rb
hyrax-2.5.0 app/services/hyrax/lease_service.rb
hyrax-3.0.0.pre.beta2 app/services/hyrax/lease_service.rb
hyrax-2.4.1 app/services/hyrax/lease_service.rb
hyrax-3.0.0.pre.beta1 app/services/hyrax/lease_service.rb
hyrax-2.4.0 app/services/hyrax/lease_service.rb