Sha256: 0be9619ae233b4ba409a2b1b013fd263fe2b90a56b4e6624b833536e8b7e5a71

Contents?: true

Size: 786 Bytes

Versions: 12

Compression:

Stored size: 786 Bytes

Contents

# frozen_string_literal: true

module Hyrax
  ##
  # The Valkyrie model for leases.
  #
  # @note Embargo and Lease can, in principle, be collapsed into a single model
  #   with a `#visibility_during`, `#visibility_after`, `#end_date`, and
  #   `#history`. We haven't made this transition in order to simplify legacy
  #   support for `Hydra::AccessControls`.
  class Lease < Valkyrie::Resource
    attribute :visibility_after_lease,  Valkyrie::Types::String
    attribute :visibility_during_lease, Valkyrie::Types::String
    attribute :lease_expiration_date,   Valkyrie::Types::DateTime
    attribute :lease_history,           Valkyrie::Types::Array

    def active?
      (lease_expiration_date.present? && Hyrax::TimeService.time_in_utc < lease_expiration_date)
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
hyrax-5.0.1 app/models/hyrax/lease.rb
hyrax-5.0.0 app/models/hyrax/lease.rb
hyrax-5.0.0.rc3 app/models/hyrax/lease.rb
hyrax-5.0.0.rc2 app/models/hyrax/lease.rb
hyrax-5.0.0.rc1 app/models/hyrax/lease.rb
hyrax-3.6.0 app/models/hyrax/lease.rb
hyrax-4.0.0 app/models/hyrax/lease.rb
hyrax-4.0.0.rc3 app/models/hyrax/lease.rb
hyrax-4.0.0.rc2 app/models/hyrax/lease.rb
hyrax-4.0.0.rc1 app/models/hyrax/lease.rb
hyrax-3.5.0 app/models/hyrax/lease.rb
hyrax-4.0.0.beta2 app/models/hyrax/lease.rb