Skip to content

Commit

Permalink
Fixed calculation of average
Browse files Browse the repository at this point in the history
  • Loading branch information
skyeagle committed Jul 14, 2013
1 parent 31c8d61 commit d675cda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/letsrate/model.rb
Expand Up @@ -28,7 +28,7 @@ def update_rate_average(stars, dimension=nil)
else
a = average(dimension)
a.qty = rates(dimension).count
a.avg = a.qty / raters(dimension).count
a.avg = rates(dimension).average(:stars)
a.save!(validate: false)
end
end
Expand Down

0 comments on commit d675cda

Please sign in to comment.