Commit f7235700fdb0ac19828f06c118141a003bd13948

Authored by Pius Uzamere
1 parent e6fec992

ensure that loss count gets updated even if it's nil

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
app/models/choice.rb
@@ -17,7 +17,7 @@ class Choice < ActiveRecord::Base @@ -17,7 +17,7 @@ class Choice < ActiveRecord::Base
17 end 17 end
18 18
19 def lose! 19 def lose!
20 - self.loss_count += 1 20 + self.loss_count += 1 rescue (self.loss_count = 1)
21 save! 21 save!
22 end 22 end
23 23