mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-13 09:20:38 -07:00
send_message optional and fixing indicator when no zones available
This commit is contained in:
parent
71745c9832
commit
f3392f685d
2 changed files with 15 additions and 10 deletions
|
|
@ -21,7 +21,7 @@ class RecipientSchedule < ApplicationRecord
|
|||
Question.where(id: upcoming.first).first
|
||||
end
|
||||
|
||||
def attempt_question(question: next_question)
|
||||
def attempt_question(send_message: true, question: next_question)
|
||||
return if recipient.opted_out?
|
||||
attempt = recipient.attempts.create(
|
||||
schedule: schedule,
|
||||
|
|
@ -29,7 +29,7 @@ class RecipientSchedule < ApplicationRecord
|
|||
question: question
|
||||
)
|
||||
|
||||
if attempt.send_message
|
||||
if send_message && attempt.send_message
|
||||
return if upcoming_question_ids.blank?
|
||||
upcoming = upcoming_question_ids.split(/,/)[1..-1].join(',')
|
||||
attempted = ((attempted_question_ids.try(:split, /,/) || []) + [question.id]).join(',')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue