Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
Reintroduce the ability to send timer reminders for arbitrary days
Browse files Browse the repository at this point in the history
This now makes more sense as timer reminders are controlled by
individual days themselves rather than by user records.
  • Loading branch information
laserlemon committed Apr 22, 2015
1 parent d3b2bde commit dc944c3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/interactors/send_timer_reminders.rb
@@ -1,10 +1,14 @@
class SendTimerReminders
include Interactor

before do
context.date ||= Date.current
end

def call
User.for_timer_reminder.each do |user|
User.for_timer_reminder(date: context.date).each do |user|
Notifier.timer_reminder(user).deliver_now
user.timer_reminder_sent!
user.timer_reminder_sent!(date: context.date)
end
end
end

0 comments on commit dc944c3

Please sign in to comment.