Watching Categories based on on group in discourse

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

Because you switched to a different method

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

Does not equal

Category.find_by_slug("site-feedback")

Note how in the file 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.

4 Likes

I have installed your plugin, but it doesn’t seem to work… :sob:
I’ve followed instruction here Install Plugins in Discourse

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

1 Like

The job runs once a day, if you look in 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.

2 Likes