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.0.1 app/services/hyrax/lease_service.rb
hyrax-2.0.0 app/services/hyrax/lease_service.rb
hyrax-2.0.0.rc3 app/services/hyrax/lease_service.rb
hyrax-2.0.0.rc2 app/services/hyrax/lease_service.rb
hyrax-2.0.0.rc1 app/services/hyrax/lease_service.rb
hyrax-1.0.5 app/services/hyrax/lease_service.rb
hyrax-2.0.0.beta5 app/services/hyrax/lease_service.rb
hyrax-2.0.0.beta4 app/services/hyrax/lease_service.rb
hyrax-2.0.0.beta3 app/services/hyrax/lease_service.rb
hyrax-2.0.0.beta2 app/services/hyrax/lease_service.rb
hyrax-2.0.0.beta1 app/services/hyrax/lease_service.rb
hyrax-1.0.4 app/services/hyrax/lease_service.rb
hyrax-1.0.3 app/services/hyrax/lease_service.rb
hyrax-1.0.2 app/services/hyrax/lease_service.rb
hyrax-1.0.1 app/services/hyrax/lease_service.rb
hyrax-1.0.0.rc2 app/services/hyrax/lease_service.rb
hyrax-1.0.0.rc1 app/services/hyrax/lease_service.rb
test_hyrax-0.0.1.alpha app/services/hyrax/lease_service.rb