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

Refactor CustomForm::SubmittedAnswer to FormAnswer #867

Open
kasugaijin opened this issue Jul 10, 2024 · 4 comments
Open

Refactor CustomForm::SubmittedAnswer to FormAnswer #867

kasugaijin opened this issue Jul 10, 2024 · 4 comments
Assignees
Labels

Comments

@kasugaijin
Copy link
Collaborator

kasugaijin commented Jul 10, 2024

** You can start this but one of the associations cannot be made until this PR is merged (which is close) https://github.com/rubyforgood/pet-rescue/pull/856/files**

After some small architectural decisions requiring changes, we need the SubmittedAnswer model to be removed from the CustomForm scope and renamed to FormAnswer. We also need the submitted_answers table to be named form_answers. Also, please update all references to the class name and methods throughout the code. Basically a find and replace exercise for part of this work.

We should also update the associations on the model:

  • has_one :organization, through: :submission
  • Get rid of belongs_to :question
  • Get rid of has_one :form, through: :question
  • Belongs_to FormSubmission (blocked until above PR merged)
@kasugaijin kasugaijin added the Ready Make a comment to get assigned. label Jul 10, 2024
@Gabe-Torres
Copy link
Contributor

Can I take this one?

@kasugaijin
Copy link
Collaborator Author

@Gabe-Torres all yours!

@kasugaijin kasugaijin removed the Ready Make a comment to get assigned. label Jul 10, 2024
@kasugaijin
Copy link
Collaborator Author

@Gabe-Torres quick update - I think we should stick to using acts_as_tenant(:organization) here (like we do on all other records) instead of making a belongs_to org through submission.

Copy link

This issue is marked as stale due to no activity within 30 days. If no further activity is detected within 7 days, it will be unassigned.

@github-actions github-actions bot added the Stale label Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants