Closed perrier closed 11 years ago
Hi!,
The function update_rate_average has a little issue in the calculation, average decrease while the quantity of votes increase.
Line 30 in letsrate/lib/letsrate/model.rb: 'a.avg = (a.avg + stars) / (a.qty+1)'
...should be: 'a.avg = (a.avg*a.qty + stars) / (a.qty+1)'
to take in account the number of votes that have the average in dividend... Maybe this calculation can be done in different way but with this it works.
Thanks!
Already solved!
Now, you can use the new version (letsrate 1.0.8)
Hi!,
The function update_rate_average has a little issue in the calculation, average decrease while the quantity of votes increase.
Line 30 in letsrate/lib/letsrate/model.rb:
'a.avg = (a.avg + stars) / (a.qty+1)'
...should be: 'a.avg = (a.avg*a.qty + stars) / (a.qty+1)'
to take in account the number of votes that have the average in dividend... Maybe this calculation can be done in different way but with this it works.
Thanks!