Use FormDocumentResource model within Form model#2028
Open
stephencdaly wants to merge 4 commits intomainfrom
Open
Use FormDocumentResource model within Form model#2028stephencdaly wants to merge 4 commits intomainfrom
stephencdaly wants to merge 4 commits intomainfrom
Conversation
93769eb to
936a271
Compare
lfdebrux
reviewed
Apr 8, 2026
lfdebrux
reviewed
Apr 8, 2026
lfdebrux
reviewed
Apr 8, 2026
Previously, the Form model was an ActiveResource model that was constructed using the JSON retrieved from the forms-admin API using the FormDocumentResource model. Make it a plain Ruby object and instead delegate attributes to the FormDocumentResource model. This means we are not using the ActiveResource model directly in the rest of the codebase, and instead consuming the Form model which has a defined interface. Future changes to the API can be handled more easily within the Form model. As part of this change, remove the code that expects that the API response can include an `id` attribute rather than `form_id` as this will no longer be the case.
The question mark on the trait doesn't make sense.
936a271 to
33adc28
Compare
Contributor
|
🎉 A review copy of this PR has been deployed! You can reach it at: https://pr-2028.submit.review.forms.service.gov.uk/ It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready For the sign in details and more information, see the review apps wiki page. |
lfdebrux
approved these changes
Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What problem does this pull request solve?
Trello card: https://trello.com/c/02H0xEqG
Previously, the Form model was an ActiveResource model that was constructed using the JSON retrieved from the forms-admin API using the FormDocumentResource model.
Make it a plain Ruby object and instead delegate attributes to the FormDocumentResource model. This means we are not using the ActiveResource model directly in the rest of the codebase, and instead consuming the Form model which has a defined interface. Future changes to the API can be handled more easily within the Form model.
Things to consider when reviewing