ratyrate icon indicating copy to clipboard operation
ratyrate copied to clipboard

Canceling rating should delete the rating

Open robban opened this issue 9 years ago • 3 comments

Currently, when you press the cancel rating button, it essentially works as a rating with zero stars. This draws down the average rating. Correct behaviour would be to delete the rating if it exists in the database.

robban avatar Nov 04 '15 15:11 robban

I am also looking for the same thing, I went through the source code of gem but did not find any method for deleting the rate.

piyushbeli avatar Mar 13 '16 06:03 piyushbeli

Just in case if somebody is looking for a patch then here it is. I overode this module and added clear_rating method. Also need to override the update_rating_cahce method to give the correct average_rating.

Please see this gist https://gist.github.com/piyushbeli/8b92068ce72d28ed155a

piyushbeli avatar Mar 13 '16 06:03 piyushbeli

@piyushbeli Thank you for the fix! I'm not sure how to implement it though, having already installed ratyrate. I can't find anything called "ratyrate" doing a project-wide search in my app. Can you provide any additional implementation advice? Thanks again!

mrobock avatar Jan 23 '17 21:01 mrobock