diff --git a/app/models/visitor.rb b/app/models/visitor.rb index fabc6fa..6e1f6ae 100644 --- a/app/models/visitor.rb +++ b/app/models/visitor.rb @@ -16,11 +16,14 @@ class Visitor < ActiveRecord::Base choices = prompt.choices choice = choices[ordinality] #we need to guarantee that the choices are in the right order (by position) prompt_vote = votes.create!(:voteable => prompt) + puts "Visitor: #{self.inspect} voted for Prompt: #{prompt.inspect}" choice_vote = votes.create!(:voteable => choice) + puts "Visitor: #{self.inspect} voted for Choice: #{choice.inspect}" choice.save! choice.score = choice.compute_score + puts "Just computed the score for that choice and it's apparently #{choice.score}" choice.save! - + puts "Saved. That choice's score is still #{choice.score}" other_choices = choices - [choice] other_choices.each {|c| c.lose! } end -- libgit2 0.21.2