diff --git a/app/models/visitor.rb b/app/models/visitor.rb index 16f7a7e..84b14b8 100644 --- a/app/models/visitor.rb +++ b/app/models/visitor.rb @@ -26,11 +26,11 @@ class Visitor < ActiveRecord::Base @click.save! choice_vote = votes.create!(:voteable => choice) - logger.info "Visitor: voted for Prompt: #{prompt.id.to_s} for choice #{choice.item.data}" - choice.save! - choice.score = choice.compute_score - logger.info "Just computed the score for that choice and it's apparently #{choice.score}" - choice.save! + # logger.info "Visitor: voted for Prompt: #{prompt.id.to_s} for choice #{choice.item.data}" + # choice.save! + # choice.score = choice.compute_score + # logger.info "Just computed the score for that choice and it's apparently #{choice.score}" + # choice.save! logger.info "Saved. That choice's score is still #{choice.score}" other_choices = choices - [choice] other_choices.each {|c| c.lose! } diff --git a/db/migrate/20091219050747_add_index_to_prompts.rb b/db/migrate/20091219050747_add_index_to_prompts.rb new file mode 100644 index 0000000..a631d98 --- /dev/null +++ b/db/migrate/20091219050747_add_index_to_prompts.rb @@ -0,0 +1,9 @@ +class AddIndexToPrompts < ActiveRecord::Migration + def self.up + add_index :prompts, [:left_choice_id, :right_choice_id] + end + + def self.down + remove_index :prompts, [:left_choice_id, :right_choice_id] + end +end -- libgit2 0.21.2