# Watching Categories based on on group in discourse

**URL:** https://meta.discourse.org/t/watching-categories-based-on-on-group-in-discourse/41488
**Category:** Development
**Created:** [March 23, 2016, 6:37pm UTC](https://meta.discourse.org/t/watching-categories-based-on-on-group-in-discourse/41488 "2016-03-23T18:37:39Z")
**Posts on this page:** 4
**Page:** 2

<div class="post-metadata">

### Author: ![Jared\_Needell](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jared_needell/32/116554_2.png) [@Jared\_Needell](https://meta.discourse.org/u/Jared_Needell)
#### Post date: [April 11, 2016, 6:36pm UTC](https://meta.discourse.org/t/watching-categories-based-on-on-group-in-discourse/41488/21 "2016-04-11T18:36:41Z")

</div>

Odd that it’s working without having to do that.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [April 11, 2016, 6:43pm UTC](https://meta.discourse.org/t/watching-categories-based-on-on-group-in-discourse/41488/22 "2016-04-11T18:43:02Z")

</div>

Because you switched to a different method

```plaintext
Category.find_by(slug: "site-feedback")

```

Does not equal

```plaintext
Category.find_by_slug("site-feedback")

```

Note how in the [file](https://github.com/discourse/discourse/blob/be3a5a56ccc284b352aa65080fc6b955f73cc72a/app/models/category.rb) there is no method defined `find_by`, there is `find_by_slug` and `find_by_email`.

That is because `find_by` is built into ActiveRecord, and you are querying the category table for any record containing `slug = 'whatever value you asked for'`, which is inherently different than using the method that exists in the category.rb file.

---

<div class="post-metadata">

### Author: ![armando](https://avatars.discourse-cdn.com/v4/letter/a/a5b964/32.png) [@armando](https://meta.discourse.org/u/armando)
#### Post date: [May 15, 2016, 11:36pm UTC](https://meta.discourse.org/t/watching-categories-based-on-on-group-in-discourse/41488/23 "2016-05-15T23:36:57Z")

</div>

I have installed your plugin, but it doesn’t seem to work… 😭  
I’ve followed instruction here [Install plugins on a self-hosted site](https://meta.discourse.org/t/install-a-plugin/19157)

After installation Discourse works fine, but it seems nothing changed: if I look at users’ profiles of the group I wanted to force to watch a category, nothing changed, the category doesn’t appear among the watched ones.

This is my fork, maybe I did some mistakes…?

> <https://github.com/don-durito/discourse-watch-category-mcneel/blob/master/plugin.rb>

---

<div class="post-metadata">

### Author: ![Jared\_Needell](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jared_needell/32/116554_2.png) [@Jared\_Needell](https://meta.discourse.org/u/Jared_Needell)
#### Post date: [May 16, 2016, 7:14pm UTC](https://meta.discourse.org/t/watching-categories-based-on-on-group-in-discourse/41488/24 "2016-05-16T19:14:57Z")

</div>

The job runs once a day, if you look in sidekiq ([http://discoursever/sidekiq](http://discoursever/sidekiq)) under scheduler, you can manually trigger a task. If you want the script to run more frequently, just update the frequency in the script.

[Previous page](https://meta.discourse.org/t/watching-categories-based-on-on-group-in-discourse/41488.md?page=1)
