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

5630 switch followups to polymorphic reads #6001

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

Conversation

acasarsa
Copy link
Collaborator

What github issue is this PR for, if any?

Resolves #XXXX

What changed, and why?

How is this tested? (please write tests!) 💖💪

Note: if you see a flake in your test build in github actions, please post in slack #casa "Flaky test: " :) 💪
Note: We love capybara tests! If you are writing both haml/js and ruby, please try to test your work with tests at every level including system tests like https://github.com/rubyforgood/casa/tree/main/spec/system

Screenshots please :)

Run your local server and take a screenshot of your work! Try to include the URL of the page as well as the contents of the page.

Feelings gif (optional)

What gif best describes your feeling working on this issue? https://giphy.com/
How to embed:

![alt text](https://media.giphy.com/media/1nP7ThJFes5pgXKUNf/giphy.gif)

* routes
* followup model
* followups_controller updates
* views updates to match new route
* followupService updates
* refactored find_followupable to use followupable_type and id passed in params
* added white listed classes for the followupable_types
* fixed namespace that was still in the classname.
* adjusted the associations on case_contact and followup to reflect polymorphic usage
* updated the existing_requested_followup? validation to work with followupable
* refactored / renamed send_followup_notification method in FollowupService to be more flexible and allow for future use of followups by other models.
* added helper to make _followup partial reusable with any model.
* refactored js file that performs the post request to work with other changes. This is a WIP though because it needs to be either removed / renamed to not be associated with case_contact or handled differently to allow for reusability across other models.
* added check for associated_casa_case so it can handle followups in other areas like directly on a casa case
* added association for casa_case to followupable
* removed casa_case as followupable for now as it was mainly there to help test that polymorph refactors worked with different followupable types
* refactor FollowupExportCsvService
* update specs for FollowupExportCsvService
* update specs for backfill
* refactor self.in_organization
* move maintain_backwards_compatability out of FollowupService and into a before_save in the Followup model
* add followupable association with default case_contact to followups factory
* update followup_spec to use polymorphic creation
@acasarsa acasarsa self-assigned this Aug 20, 2024
@github-actions github-actions bot added javascript for use by Github Labeler to mark pull requests that update Javascript code ruby Pull requests that update Ruby code Tests! 🎉💖👏 erb labels Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
erb javascript for use by Github Labeler to mark pull requests that update Javascript code ruby Pull requests that update Ruby code Tests! 🎉💖👏
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant