wazery / ratyrate

:star: A Ruby Gem that wraps the functionality of jQuery Raty library, and provides optional IMDB style rating.
http://ratingmoviestore.herokuapp.com
237 stars 120 forks source link

Bug when save the rating in database #156

Open ghost opened 6 years ago

ghost commented 6 years ago

When user clicks for rating 5 for the example, the rating in rates table is not 5, but 4.* or float which is not correct, because user wants to set an reting 5 . If half star is enabled and 2 users want to select 3.5 rating, average rating can be something like (3.222 + 3.333)/2 or 3.2775 the helper will round it to 3, which is not correct. The correct average rating in this case must be 3.5, and their ratings must be 3.5