I'm looking for a way to test whether the RedmineStealth plugin/module has been loaded in a given Redmine instance. The Redmine plugin internals FAQ suggests:
If your project is in the @project variable:
if @project.module_enabled?("")
but this plugin is not registered as a project-level module. More generally, sometimes Ruby modules define a constant that you can check against, e.g.
if defined?(ActiveSupport)
but I don't see any such constant in RedmineStealth.
Is there another clean way to check? I'm working on an extension to alert users about who was notified by email when they make a change. Since we use the RedmineStealth plugin, sometimes people who would normally be alerted are not, so I want my code to reflect that, but at the same time not break for another Redmine instance that doesn't use RedmineStealth.
I'm looking for a way to test whether the RedmineStealth plugin/module has been loaded in a given Redmine instance. The Redmine plugin internals FAQ suggests:
If your project is in the @project variable: if @project.module_enabled?("")
but this plugin is not registered as a project-level module. More generally, sometimes Ruby modules define a constant that you can check against, e.g.
if defined?(ActiveSupport)
but I don't see any such constant in RedmineStealth.
Is there another clean way to check? I'm working on an extension to alert users about who was notified by email when they make a change. Since we use the RedmineStealth plugin, sometimes people who would normally be alerted are not, so I want my code to reflect that, but at the same time not break for another Redmine instance that doesn't use RedmineStealth.