-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add remove services for collections, objects, and related objects. #104
Conversation
1 similar comment
742c9de
to
ae111d5
Compare
ae111d5
to
7b4486c
Compare
1 similar comment
@@ -10,8 +10,7 @@ class GetRelatedObjectsFromCollection | |||
|
|||
def self.call( parent_collection ) | |||
raise ArgumentError, "parent_collection must be a pcdm collection" unless Hydra::PCDM.collection? parent_collection | |||
|
|||
parent_collection.related_objects | |||
parent_collection.related_objects.to_a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to call to_a here? Why? to_a can be less efficient if they only want the first element of the association.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two reasons for the related_object.to_a
- related_objects.include? raises an error in some cases (This should be fixed when issue related_objects.delete should return deleted object (not array) or nil samvera-deprecated/activefedora-aggregation#36 is fixed)
- col1.collections and col1.objects in collection_behaviors each returns an Array and is surfaced through services as GetCollectionsFromCollection and GetObjectsFromCollection. For consistency in processing, col1.related_objects surfaced through GetRelatedObjectsFromCollection should return an Array.
NOTE: Same applies for related objects in pcdm objects.
f5e842f
to
1c3b809
Compare
New Services: * RemoveCollectionFromCollection * RemoveObjectFromCollection * RemoveRelatedObjectFromCollection * RemoveObjectFromObject * RemoveRelatedObjectFromObject Updated Services: * GetRelatedObjectsFromCollection - return array * GetRelatedObjectsFromObject - return array
1c3b809
to
fd27ef1
Compare
1 similar comment
Add remove services for collections, objects, and related objects.
New Services:
Updated Services: