Module: Hyrax::FileSet::BelongsToWorks
- Extended by:
- ActiveSupport::Concern
- Included in:
- Hyrax::FileSetBehavior
- Defined in:
- app/models/concerns/hyrax/file_set/belongs_to_works.rb
Instance Method Summary collapse
-
#parent ⇒ Object
Returns the first parent object This is a hack to handle things like FileSets inheriting access controls from their parent.
- #parents ⇒ Object
-
#related_files ⇒ Object
Files with sibling relationships Returns all FileSets aggregated by any of the parent objects that aggregate the current object.
Instance Method Details
#parent ⇒ Object
Returns the first parent object This is a hack to handle things like FileSets inheriting access controls from their parent. (see Hyrax::ParentContainer in app/controllers/concerns/curation_concers/parent_container.rb)
13 14 15 |
# File 'app/models/concerns/hyrax/file_set/belongs_to_works.rb', line 13 def parent parents.first end |
#parents ⇒ Object
7 8 9 |
# File 'app/models/concerns/hyrax/file_set/belongs_to_works.rb', line 7 def parents in_works end |
#related_files ⇒ Object
Files with sibling relationships Returns all FileSets aggregated by any of the parent objects that aggregate the current object
24 25 26 27 28 29 30 31 32 |
# File 'app/models/concerns/hyrax/file_set/belongs_to_works.rb', line 24 def parent_objects = parents return [] if parent_objects.empty? parent_objects.flat_map do |work| work.file_sets.reject do |file_set| file_set.id == id end end end |