Class: EmbargoExpiryJob
- Inherits:
-
Hyrax::ApplicationJob
- Object
- ApplicationJob
- Hyrax::ApplicationJob
- EmbargoExpiryJob
- Defined in:
- app/jobs/embargo_expiry_job.rb
Instance Method Summary collapse
- #perform ⇒ Object
-
#records_with_expired_embargos ⇒ Enumerator<Valkyrie::Resource>
Ids for all the objects that have expired active embargoes.
Instance Method Details
#perform ⇒ Object
3 4 5 6 7 8 |
# File 'app/jobs/embargo_expiry_job.rb', line 3 def perform .each do |resource| Hyrax::EmbargoManager.(resource: resource) && Hyrax::AccessControlList(resource).save end end |
#records_with_expired_embargos ⇒ Enumerator<Valkyrie::Resource>
Returns ids for all the objects that have expired active embargoes.
12 13 14 15 16 |
# File 'app/jobs/embargo_expiry_job.rb', line 12 def ids = Hyrax::EmbargoService..map(&:id) Hyrax.query_service.find_many_by_ids(ids: ids) end |