Module: Hyrax::WithEmbargoesAndLeases
- Extended by:
- ActiveSupport::Concern
- Included in:
- Resource
- Defined in:
- app/models/concerns/hyrax/with_embargoes_and_leases.rb
Instance Method Summary collapse
Instance Method Details
#embargo ⇒ Object
13 14 15 16 |
# File 'app/models/concerns/hyrax/with_embargoes_and_leases.rb', line 13 def return if = Hyrax.query_service.find_by(id: ) if .present? end |
#embargo=(value) ⇒ Object
6 7 8 9 10 11 |
# File 'app/models/concerns/hyrax/with_embargoes_and_leases.rb', line 6 def (value) raise TypeError "can't convert #{value.class} into Hyrax::Embargo" unless value.is_a? Hyrax:: = value self. = .id end |
#lease ⇒ Object
25 26 27 28 |
# File 'app/models/concerns/hyrax/with_embargoes_and_leases.rb', line 25 def lease return @lease if @lease @lease = Hyrax.query_service.find_by(id: lease_id) if lease_id.present? end |
#lease=(value) ⇒ Object
18 19 20 21 22 23 |
# File 'app/models/concerns/hyrax/with_embargoes_and_leases.rb', line 18 def lease=(value) raise TypeError "can't convert #{value.class} into Hyrax::Lease" unless value.is_a? Hyrax::Lease @lease = value self.lease_id = @lease.id end |