Stop use of "mail_status" and "sent_at" in Submissions model#1549
Conversation
12d688f to
b1898bb
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR removes usage of deprecated columns mail_status and sent_at from the Submissions model, replacing them with the newer delivery_status and last_delivery_attempt columns. The changes prepare the codebase for eventual removal of the deprecated columns.
- Updates submission factory to only use the new
delivery_statuscolumn - Removes duplicate enum methods and scopes that referenced both old and new columns
- Updates all test cases to use simplified enum values (
pending/bouncedinstead ofdelivery_pending/delivery_bounced)
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| app/models/submission.rb | Adds ignored columns directive and removes deprecated enum/methods |
| app/jobs/send_submission_job.rb | Updates job to only set new delivery status columns |
| app/jobs/delete_submissions_job.rb | Simplifies query to only use last_delivery_attempt column |
| spec/factories/submissions.rb | Removes mail_status from factory definition |
| spec/models/submission_spec.rb | Updates tests to use new enum values and removes deprecated tests |
| spec/services/form_submission_service_spec.rb | Updates expectation to use last_delivery_attempt |
| spec/jobs/send_submission_job_spec.rb | Updates test to check last_delivery_attempt instead of sent_at |
| spec/jobs/receive_submission_deliveries_job_spec.rb | Updates test data to use new enum values |
| spec/jobs/receive_submission_bounces_and_complaints_job_spec.rb | Updates test data to use new enum values |
| spec/jobs/delete_submissions_job_spec.rb | Removes test cases for deprecated columns and updates expectations |
| spec/lib/tasks/submissions.rake_spec.rb | Updates all test cases to use new enum values |
5bdf6fd to
c23ad92
Compare
|
🎉 A review copy of this PR has been deployed! It is made of up two components Important Not all of the functionality of forms-runner is present in review apps. You should use the full dev environment to test the functionality which is disabled here. It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready For the sign in details and more information, see the review apps wiki page. |
DavidBiddle
left a comment
There was a problem hiding this comment.
Changes make sense to me. Have tested locally and the submission process still works for me
This removes references and usage on the old column names.
c23ad92 to
acdeb71
Compare
|



These columns had be deprecated and the existing data replicated into the new columns "delivery_status" and "last_delivery_attempt".
This removes the use of the columns from the code base in preparation for the column to be dropped.