Class: VisibilityCopyJob
- Inherits:
-
ActiveJob::Base
- Object
- ActiveJob::Base
- VisibilityCopyJob
- Defined in:
- app/jobs/visibility_copy_job.rb
Instance Method Summary collapse
Instance Method Details
#perform(work) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/jobs/visibility_copy_job.rb', line 2 def perform(work) work.file_sets.each do |file| file.visibility = work.visibility # visibility must come first, because it can clear an embargo/lease if work.lease file.build_lease unless file.lease file.lease.attributes = work.lease.attributes.except('id') file.lease.save end if work. file. unless file. file..attributes = work..attributes.except('id') file..save end file.save! end end |