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

Instance Method Details

#before_destroy_cleanup_file_setsObject



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_filesObject



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_idsObject

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