Module: CurationConcerns::WithFileSets
- Extended by:
- ActiveSupport::Concern
- Included in:
- WorkBehavior
- Defined in:
- app/models/concerns/curation_concerns/with_file_sets.rb
Instance Method Summary collapse
- #cleanup_file_sets ⇒ Object
- #copy_visibility_to_files ⇒ Object
-
#file_set_ids ⇒ Object
Stopgap unil ActiveFedora ContainerAssociation includes an *_ids accessor.
Instance Method Details
#cleanup_file_sets ⇒ Object
17 18 19 20 21 22 23 |
# File 'app/models/concerns/curation_concerns/with_file_sets.rb', line 17 def cleanup_file_sets # Destroy the list source first. This prevents each file_set from attemping to # remove itself individually from the work. If hundreds of files are attached, # this would take too long. list_source.destroy file_sets.each(&:destroy) end |
#copy_visibility_to_files ⇒ Object
25 26 27 28 29 30 |
# File 'app/models/concerns/curation_concerns/with_file_sets.rb', line 25 def copy_visibility_to_files file_sets.each do |fs| fs.visibility = visibility fs.save! end end |
#file_set_ids ⇒ Object
Stopgap unil ActiveFedora ContainerAssociation includes an *_ids accessor. At the moment, this is no more efficient than calling file_sets, but hopefully that will change in the future.
13 14 15 |
# File 'app/models/concerns/curation_concerns/with_file_sets.rb', line 13 def file_set_ids file_sets.map(&:id) end |