Any support for loading rake tasks defined in plugins?

I need to be able to run custom tasks against a Discourse forum. Is there any way of loading rake tasks defined in a plugin so that these can be used in production?

I think this should work. Just put them in the same directory in the plugin as where they live in core.

I’ve done this in the past with creating a rake task that runs after another but haven’t created a standalone task.

3 Likes

Yep this works. It didn’t appear to work for me at first hence me asking the question, but I’ve tried this again and works first time.

I added my rake task in lib/tasks in my plugin. Thought I’d confirm this works for anyone else that stumbles upon this.

1 Like