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

12193 remove json blob for Answers, remove internal_name etc, and use nested forms to save Answers #968

Draft
wants to merge 87 commits into
base: develop
Choose a base branch
from

Conversation

DevneyHamilton
Copy link
Contributor

@DevneyHamilton DevneyHamilton commented May 18, 2022

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 (canceled): 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 phase 2 in the above phases.

…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
… 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
…e info only calculating in question editing, and not in questionnaire loading
…internal name usage to see what's going on and replace with nested attrs
…cursion; progress logic not yet re-implemented
# Conflicts:
#	db/schema.rb
#	lib/tasks/one_time_changes.rake
# Conflicts:
#	Gemfile.lock
#	app/models/answer.rb
#	db/schema.rb
…roup questions must contain string 'field' to identify form fields that need to be saved as answers.
# Conflicts:
#	app/models/question.rb
#	db/schema.rb
…, and move the internal_name containing field migration earlier in migration history
…r migrations already deployed to staging and prod
# Conflicts:
#	db/migrate/20220330205139_ensure_internal_names_contain_field.rb
#	db/schema.rb

And move migrations for removing internal name from questions and custom data from response sets to after all 'answers migration' db migrations.
@DevneyHamilton DevneyHamilton changed the title 12193 remove internal name 12193 remove json blob for answers, remove internal name, and use nested forms to save Answers Jun 15, 2023
@DevneyHamilton DevneyHamilton changed the title 12193 remove json blob for answers, remove internal name, and use nested forms to save Answers 12193 remove json blob for Answers, remove internal_name etc, and use nested forms to save Answers Jun 15, 2023
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.

1 participant