-
Notifications
You must be signed in to change notification settings - Fork 2
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
Validate constituents before creating virtual object #366
Conversation
app/services/item_query_service.rb
Outdated
@@ -11,6 +11,20 @@ def initialize(id:, item_relation: default_item_relation) | |||
|
|||
delegate :allows_modification?, to: :item | |||
|
|||
# @param [Array] druids a list of druids | |||
# @raises [RuntimeError] if any items are dark, citation_only, or not modifiable |
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.
I don’t think this raises
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.
It does not. Good 👁️. This was from a prior implementation I worked on. Removing.
Fixes #365 Includes: * Add `ItemQueryService.validate_combinable_items`. This new class method takes an array of druids and makes sure each is combinable. If any are not, a hash of errors is created and returned. * Validate all items to be combined before modifying any of them * Return HTTP 422 when constituent service returns errors
d1894f7
to
d2bcc7b
Compare
@jcoyne this is ready for another look now. Thanks for the review! |
Fixes #365
Includes:
ItemQueryService.validate_combinable_items
. This new class method takes an array of druids and makes sure each is combinable. If any are not, a hash of errors is created and returned.