# Topic Ratings Plugin

**URL:** https://meta.discourse.org/t/topic-ratings-plugin/39578
**Category:** Plugin
**Tags:** pavilion
**Created:** [February 14, 2016, 9:06pm UTC](https://meta.discourse.org/t/topic-ratings-plugin/39578 "2016-02-14T21:06:53Z")
**Posts on this page:** 1
**Showing post:** 14

<div class="post-metadata">

### Author: ![fackelwind](https://avatars.discourse-cdn.com/v4/letter/f/c67d28/32.png) [@fackelwind](https://meta.discourse.org/u/fackelwind)
#### Post date: [February 23, 2016, 5:09pm UTC](https://meta.discourse.org/t/topic-ratings-plugin/39578/14 "2016-02-23T17:09:43Z")

</div>

> [@angus](#):
>
> I have made sure the topic averages will not be applied to new topics in a non-ratings category or without the ratings tag. Unfortunately this won’t fix existing topics with empty ratings you’ve made in your instance. If that is a significant issue, I’ll see if I can figure out how to fix it.

This is a significant issue, but not in the way you think. Having an SQL query to run against the DB (to remove the empty ratings) would not really help.  
Think about this: How do you intend to handle the case where someone removes the “rating” tag from a topic? Or in any other way removes a topic from being a rated one?  
I would argue that the only sane way for you to handle that case is to treat it as a vanilla topic: No stars, no possibility to rate, no restrictions in the amount of posts. So you don’t only look whether there are ratings when deciding on whether to draw stars or not, you always check whether the topic fulfills the criteria of being a rated one. (I have honestly no idea what you intend to do when someone tags an existing topic with “rating”, the setting to restrict it to one post per user is active, and users have already posted more than once…)

And if you have implement that, I won’t have any problems with stale ratings either. 😉

I’ve got a discourse docker instance lying around on my desktop. Tell me when you have a version which you think should work, and I’ll test it there. 😃

---

_[View the full topic](https://meta.discourse.org/t/topic-ratings-plugin/39578)._
