Skip to content
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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Conversation

SamJamCul
Copy link
Contributor

@SamJamCul SamJamCul commented Jun 19, 2024

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

  • Ensure that you consider the wider context.
  • Does it work when run on your machine?
  • Is it clear what the code is doing?
  • Do the commit messages explain why the changes were made?
  • Are there all the unit tests needed?
  • Has all relevant documentation been updated?

Copy link

sonarcloud bot commented Jun 20, 2024

@@ -64,6 +64,8 @@ gem "validate_url"
# For pausing pipelines
gem "aws-sdk-codepipeline", "~> 1.74"

gem "active_model_serializers"
Copy link
Contributor

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)

Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants