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 @embargo if @embargo @embargo = 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::Embargo @embargo = value self. = @embargo.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 |