# 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:** 6

<div class="post-metadata">

**Author:** ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)\
**Post date:** [February 22, 2016, 2:59am UTC](https://meta.discourse.org/t/topic-ratings-plugin/39578/6 "2016-02-22T02:59:03Z")

</div>

@fackelwind Thanks for the feedback! I appreciate it. This precipitated a significant refactor to get it working as expected. In retrospect I’m surprised it worked before at all…

[https://github.com/angusmcleod/discourse-ratings/commit/2b766fae0e730f63d83a3c7c42c51fa7c0df8827](https://github.com/angusmcleod/discourse-ratings/commit/2b766fae0e730f63d83a3c7c42c51fa7c0df8827)

[https://github.com/angusmcleod/discourse-ratings/commit/94ad34bc8423db0e592dd596e806a8357178c0e5](https://github.com/angusmcleod/discourse-ratings/commit/94ad34bc8423db0e592dd596e806a8357178c0e5)

The only thing that doesn’t work now is the topic average will not get automatically updated for other users when a new user publishes a post with a rating or edits a rating in a post. Other users will see the updated rating on the new or updated post itself, but the topic average rating won’t update until those other users refresh. I will fix that soon.

Here’s a screencast demonstrating the functionality: [http://quick.as/b1wbSOa9g](http://quick.as/b1wbSOa9g)

@zogstrip @riking Hey guys, could you give me some advice on the best way to push topic updates to other clients from the server? I’m pushing the post updates using the aptly named post method `publish_change_to_clients` which [uses the MessageBus](https://github.com/discourse/discourse/blob/1bb485fca50c7c235ea307f5b51bb0366f80317b/app/models/post.rb#L107). But I’m not sure of the best way to do the same for the `average_rating` custom field [I’ve created for topics](https://github.com/angusmcleod/discourse-ratings/blob/master/plugin.rb#L35). I can send it to back to the current user’s client easily enough, but other clients? I’m sure it’s relatively straight forward, but with my basic ruby skills the answer isn’t jumping out at me…

---

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