-
Notifications
You must be signed in to change notification settings - Fork 0
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
12179 create Answers table and migrate existing response data to populate it #966
Open
DevneyHamilton
wants to merge
32
commits into
develop
Choose a base branch
from
12179_answers_migration
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
…one response set example
# Conflicts: # db/schema.rb
… on spec that was failing
…an, and editing answers works, using answers table, needs auto testing
…ing between answer and old style json for not applicable and boolean data type questions
… some meaningful answer data
… support flag about whether to include text like numeric answers
… a problem that needs to be fixed next. pause here to try changing form to use question id.
…reating "field_" internal names before id is available
…divisions with inherited question sets
…e info only calculating in question editing, and not in questionnaire loading
DevneyHamilton
commented
May 11, 2022
@@ -74,9 +50,10 @@ def questions | |||
end | |||
|
|||
def question_sets | |||
# We want self to come first for deterministic behavior in specs. After that it doesn't really matter. | |||
# self_and_descendants orders by depth so we are good. | |||
division.self_and_descendants.flat_map { |d| QuestionSet.where(division: d).order(:kind).to_a } |
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.
the previous version of this meant that if one is in a division that inherits question set(s) from ancestor divisions when making a data export, those inherited question sets were skipped.
…as 'no' because '' != "yes"
# Conflicts: # db/schema.rb # lib/tasks/one_time_changes.rake
…roup questions must contain string 'field' to identify form fields that need to be saved as answers.
…r migrations already deployed to staging and prod
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.
Business planning loads slowly because for over 300 questions and their corresponding answers, Madeline has to extract question and answer data from the database, associate answers with questions, assign required-or-not status to questions based on the loan type, render the question/answer heirarchy into html, and then make javascript adjustments to every question and answer in the browser. The way to reduce loading time is to load fewer questions and answers at once. Loading these questions in smaller portions requires:
Phase 1: replace a single json blob holding all 300+ answers in one database cell with a database table where each answer has its own row (engineering done, needs careful release)
Phase 2: replace an unconventional saving mechanism that can’t be adjusted with conventional Rails form saving (engineering done, needs careful release)
Phase 3: divide the existing credit memo questionnaire such that each top-level section can be saved and loaded separately (engineering in progress). Maintain all legacy data through this change.
This PR represents a 'first phase' of of the three above. In this phase:
The next phase will involve:
Phase 3:
Future:
This move to answers table instead of json blob, and accompanying clean up, opens up the possibility for modernizing the form system to have a responsive frontend (e.g. with React) and an API.