Commit 937e47a307364b4e43f9e02445a832d878e29eb5
1 parent
5799d21b
Exists in
master
and in
1 other branch
fix typo in variable assignment
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 | - Choice.connection = conn | 73 | + conn = Choice.connection |
74 | conn.execute("UPDATE #{conn.quote_table_name('choices')} SET | 74 | conn.execute("UPDATE #{conn.quote_table_name('choices')} SET |
75 | #{conn.quote_column_name('score')} = #{self.score}, | 75 | #{conn.quote_column_name('score')} = #{self.score}, |
76 | #{conn.quote_column_name('updated_at')} = '#{Time.now.utc.to_s(:db)}' WHERE | 76 | #{conn.quote_column_name('updated_at')} = '#{Time.now.utc.to_s(:db)}' WHERE |