Closed elrayle closed 8 years ago
did you try in_objects
?
Hi Folks, Just wondering if any update on this....We are assigning a fileset into a work
wrk.members << fs fs.in_works => [] fs.in_objects => [] fs.in_objects? => undefined method `in_objects?'
I notice the following comment in the Dive into Hydra tutorial Lesson 6: create instances of hydra works models bf.in_works ### TODO in_works returns []
@roryegerton No, I don't believe this is an update on this. Instead of appending to members
, can you use ordered_members
in the meantime?
cc: @jcoyne @tpendragon @elrayle the issue here is that in_objects
(in hydra-pcdm) uses ordered_by
(from activefedora-aggregation).
@roryegerton This is now resolved in the underlying hydra-pcdm gem, and will be resolved in hydra-works when it picks up the next release of hydra-pcdm. Thanks for the reminder!
Hi Folks, thanks a million for this. We did:
ordered_members << fileset
And works fine
Cool, @roryegerton. If you don't need ordering among the members, you may now also use members.<<
since the bug was fixed. Glad to hear you've got a working solution.
To reproduce...
If the model defines that a file set can belong to one and only one work, then the method in_work should return the work wrk. If a file set can belong to multiple works, then method in_works should return all works that have the file set fs as a member.