-
Notifications
You must be signed in to change notification settings - Fork 4
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
Spike add multiple answers #509
base: main
Are you sure you want to change the base?
Conversation
To serialize a form, use: ``` FormSnapshotSerializer.new(Form.first).as_json(include: '**') ```
Quality Gate passedIssues Measures |
@@ -64,6 +64,8 @@ gem "validate_url" | |||
# For pausing pipelines | |||
gem "aws-sdk-codepipeline", "~> 1.74" | |||
|
|||
gem "active_model_serializers" |
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 is fine for proof of concept but we shouldn't use this gem as it's not fully released (and has gone into maintenance mode) https://github.com/rails-api/active_model_serializers?tab=readme-ov-file#alternatives
I think we should be able to do something like:
JSON.generate(Form.includes(:question_steps).where("form.id = ?", 1).to_h)
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.
Yeh good point about the gem. I was just scouring the internet for something that we could use to spit out the JSON in the desired format, I'm sure we can find a way without using this particular gem.
What problem does this pull request solve?
https://trello.com/c/pCD4fbNi/1583-spike-work-out-how-to-account-for-routing-and-question-sets
See related ADR034
Things to consider when reviewing