-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
delete 5 year old drafts from expired vacancies
- Loading branch information
Showing
4 changed files
with
21 additions
and
17 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
app/jobs/delete_old_draft_applications_for_expired_vacancies_job.rb
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class DeleteOldDraftApplicationsForExpiredVacanciesJob < ApplicationJob | ||
queue_as :low | ||
|
||
def perform | ||
JobApplication.joins(:vacancy) | ||
.draft | ||
.where(job_applications: { updated_at: ...5.years.ago }) | ||
.merge(Vacancy.expired) | ||
.find_each(&:destroy!) | ||
end | ||
end |
10 changes: 0 additions & 10 deletions
10
app/jobs/withdraw_draft_applications_for_expired_vacancies_job.rb
This file was deleted.
Oops, something went wrong.
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
12 changes: 5 additions & 7 deletions
12
...cations_for_expired_vacancies_job_spec.rb → ...cations_for_expired_vacancies_job_spec.rb
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