Commit 0e2a3594ad749244ca6d340844f3bb4bbdb40cf2
1 parent
fc41a7ca
Exists in
master
and in
1 other branch
update Choice.update_score! to use manual query
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
app/models/choice.rb
| @@ -70,7 +70,7 @@ class Choice < ActiveRecord::Base | @@ -70,7 +70,7 @@ class Choice < ActiveRecord::Base | ||
| 70 | 70 | ||
| 71 | def compute_score! | 71 | def compute_score! |
| 72 | self.score = compute_score | 72 | self.score = compute_score |
| 73 | - save! | 73 | + Choice.connection.execute("UPDATE `choices` SET `score` = #{self.score}, `updated_at` = '#{Time.now.utc.to_s(:db)}' WHERE `id` = #{self.id}") |
| 74 | end | 74 | end |
| 75 | 75 | ||
| 76 | def user_created | 76 | def user_created |