don't survey on weekends

This commit is contained in:
Jared Cosulich 2017-04-15 16:33:25 -04:00
parent aee434a148
commit 7dc603b7ee
2 changed files with 23 additions and 4 deletions

View file

@ -1,10 +1,12 @@
namespace :survey do
desc 'Text all Recipients ready for an Attempt'
desc 'Text all Recipients ready for an Attempt (only on weekdays)'
task :attempt_questions => :environment do
Schedule.active.each do |schedule|
schedule.recipient_schedules.ready.each do |recipient_schedule|
recipient_schedule.attempt_question
if Date.today.on_weekday?
Schedule.active.each do |schedule|
schedule.recipient_schedules.ready.each do |recipient_schedule|
recipient_schedule.attempt_question
end
end
end
end