1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-03 14:24:23 +01:00
fab-manager/app/workers/child_age_worker.rb
2023-07-12 09:29:16 +02:00

16 lines
438 B
Ruby

# frozen_string_literal: true
# send a notification if child age > 18 years ago
class ChildAgeWorker
include Sidekiq::Worker
def perform
children = Child.where('birthday = ?', 18.years.ago + 2.days)
children.each do |child|
NotificationCenter.call type: 'notify_user_when_child_age_will_be_18',
receiver: child.user,
attached_object: child
end
end
end