-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can related objects be repeated? #92
Comments
#related_objects returns doubles? That seems unlikely, I'd expect #ordered_related_objects to do that |
The model doesn't really say anything about whether there can be multiple instances of an item in the related_objects (though it does say that they're not ordered). I don't remember a use case for multiples, though in this case it looks like it would be easier to allow them, right? |
From my talks with others, I am under the impression that related_objects are not ordered and therefore should do not repeat. That said, they are created as indirect containers via ActiveFedora::Aggregation which does allow for ordering. So we would have to do something to prevent the ordering. Perhaps they should be created as direct containers. |
I'm not sure that using DirectContainers changes anything: if we're using proxies, then you can have multiple proxies referring to the same item, unless we go out of our way to prevent that. Maybe we need a validator to check whether the item is already in the related_objects list, and reject duplicates? |
Service AddRelatedObjectToCollection/Object use the following to add the related object.
Should the following result in related_objects = [object1,object2] OR [object1,object2,object1]
Right now, it results in the later.
See test hdra/pcdm/services/collection/add_related_object_spec.rb xit 'should NOT allow related objects to repeat'
See test hdra/pcdm/services/object/add_related_object_spec.rb xit 'should NOT allow related objects to repeat'
The text was updated successfully, but these errors were encountered: