Commit 968b95459c88fb9fc8a523105fcf61e4fb354102
1 parent
2f4bd214
Exists in
master
and in
1 other branch
db optimizations
Showing
2 changed files
with
14 additions
and
5 deletions
Show diff stats
app/models/visitor.rb
| @@ -26,11 +26,11 @@ class Visitor < ActiveRecord::Base | @@ -26,11 +26,11 @@ class Visitor < ActiveRecord::Base | ||
| 26 | @click.save! | 26 | @click.save! |
| 27 | 27 | ||
| 28 | choice_vote = votes.create!(:voteable => choice) | 28 | choice_vote = votes.create!(:voteable => choice) |
| 29 | - logger.info "Visitor: voted for Prompt: #{prompt.id.to_s} for choice #{choice.item.data}" | ||
| 30 | - choice.save! | ||
| 31 | - choice.score = choice.compute_score | ||
| 32 | - logger.info "Just computed the score for that choice and it's apparently #{choice.score}" | ||
| 33 | - choice.save! | 29 | + # logger.info "Visitor: voted for Prompt: #{prompt.id.to_s} for choice #{choice.item.data}" |
| 30 | + # choice.save! | ||
| 31 | + # choice.score = choice.compute_score | ||
| 32 | + # logger.info "Just computed the score for that choice and it's apparently #{choice.score}" | ||
| 33 | + # choice.save! | ||
| 34 | logger.info "Saved. That choice's score is still #{choice.score}" | 34 | logger.info "Saved. That choice's score is still #{choice.score}" |
| 35 | other_choices = choices - [choice] | 35 | other_choices = choices - [choice] |
| 36 | other_choices.each {|c| c.lose! } | 36 | other_choices.each {|c| c.lose! } |