Commit 03752ae417b2178acfccc42504c0288100c802dc

Authored by Luke Baker
1 parent 39412fc9

when activating a choice, don't call Question.choose_prompt

Add delayed job directly, instead of calling choose_prompt which was
causing issues with tracking prompt_cache_hits and the API test.
Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
app/models/choice.rb
@@ -29,8 +29,8 @@ class Choice < ActiveRecord::Base @@ -29,8 +29,8 @@ class Choice < ActiveRecord::Base
29 def update_prompt_queue 29 def update_prompt_queue
30 if self.changed.include?('active') && self.active? 30 if self.changed.include?('active') && self.active?
31 self.question.mark_prompt_queue_for_refill 31 self.question.mark_prompt_queue_for_refill
32 - if self.question.choices.size - self.question.inactive_choices_count > 1  
33 - self.question.choose_prompt 32 + if self.question.choices.size - self.question.inactive_choices_count > 1 && self.question.uses_catchup?
  33 + self.question.send_later :add_prompt_to_queue
34 end 34 end
35 end 35 end
36 end 36 end