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
- #before_destroy_cleanup_file_sets ⇒ Object
- #copy_visibility_to_files ⇒ Object
-
#file_set_ids ⇒ Object
Stopgap unil ActiveFedora ContainerAssociation includes an *_ids accessor.
Instance Method Details
#before_destroy_cleanup_file_sets ⇒ Object
17 18 19 |
# File 'app/models/concerns/curation_concerns/with_file_sets.rb', line 17 def before_destroy_cleanup_file_sets file_sets.each(&:destroy) end |
#copy_visibility_to_files ⇒ Object
21 22 23 24 25 26 |
# File 'app/models/concerns/curation_concerns/with_file_sets.rb', line 21 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 |