Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Y24-190: Support Limber with Submission creation #4555
Y24-190: Support Limber with Submission creation #4555
Changes from 9 commits
d136efd
342d7ef
281502a
56c042a
eb27efe
c27f698
2e9c54f
8348f31
70bbbef
0b22fe1
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Curious about that restriction and also state being read only.
Wondering if we need to be able to directly update submission state. Or if's all done indirectly through requests...
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.
This pull request takes an endpoint that could not previously be created or updated (i.e. it was
immutable
) and adds a create POST endpoint while still leaving the update PATCH endpoint turned off. If we need to update state, it's not needed so far, but could be enabled carefully in future.immutable
in the resource effectively adds, only: %i[show]
to the route without explicitly writing it. I think it's a poor choice by the gem creators and they should expect you to just add that annotation to the routes file instead so it's explicit. As it is, you cannot tell from the routes alone which are immutable and which are full access.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.
what's going on with this change (and the one below)?
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.
Hmm yeah that isn't clear from these changes alone is it? The
SubmissionsController
has a dubious method override in it which modifies the fields being returned by the API to only be the[uuid,name,state,created_at,updated_at]
set if you didn't specify. As such, our tests for including relationships fail for ones that aren't in that set. I don't think there should be a default set of fields that you have to override in your request, but it's an existing endpoint and I don't want to break usage somewhere. So instead I make the request in the test explicitly ask for the one relationship to be included in the response (and no other fields for that matter). As that's the only field we want to check for anyway, it's more optimal, but that's not why I implemented it this way as I agree it's ugly and should be unnecessary for any other resource.