summaryrefslogtreecommitdiffstats
path: root/app/models/project.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index a25513baf..c5392d7b0 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -622,9 +622,16 @@ class Project < ActiveRecord::Base
end
end
- def module_enabled?(module_name)
- module_name = module_name.to_s
- enabled_modules.detect {|m| m.name == module_name}
+ # Return the enabled module with the given name
+ # or nil if the module is not enabled for the project
+ def enabled_module(name)
+ name = name.to_s
+ enabled_modules.detect {|m| m.name == name}
+ end
+
+ # Return true if the module with the given name is enabled
+ def module_enabled?(name)
+ enabled_module(name).present?
end
def enabled_module_names=(module_names)