Skip to content

Commit

Permalink
Merge pull request rubyforgood#4059 from rubyforgood/lr-use-transitio…
Browse files Browse the repository at this point in the history
…n-age-constant
  • Loading branch information
compwron authored Oct 12, 2022
2 parents 4793421 + 6cb7096 commit 7bf148c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion db/seeds/db_populator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def order_choices
end

def transition_aged_youth?(birth_month_year_youth)
(Date.today - birth_month_year_youth).days.in_years > 14
(Date.today - birth_month_year_youth).days.in_years > CasaCase::TRANSITION_AGE
end

def create_cases(casa_org, options)
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/emancipation_checklist_reminder.rake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
desc "Create a notification for volunteers with transition aged youth to utilize the Emancipation Checklist, scheduled once per month in Heroku Scheduler"
task emancipation_checklist_reminder: :environment do
if Date.today.day == 1
CaseAssignment.active.includes(:casa_case, :volunteer).where(casa_cases: {birth_month_year_youth: ..14.years.ago}).each do |assignment|
CaseAssignment.active.includes(:casa_case, :volunteer).where(casa_cases: {birth_month_year_youth: ..CasaCase::TRANSITION_AGE.years.ago}).each do |assignment|
EmancipationChecklistReminderNotification
.with(casa_case: assignment.casa_case)
.deliver(assignment.volunteer)
Expand Down

0 comments on commit 7bf148c

Please sign in to comment.