Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

replace reject with include? with difference

Ivan Kuchinc86f3644e364
diff --git a/lib/open_project/access_control.rb b/lib/open_project/access_control.rb
index c24cd1b658b..0da32c86563 100644
--- a/lib/open_project/access_control.rb
+++ b/lib/open_project/access_control.rb
@@ -131,11 +131,11 @@ module OpenProject
end
def available_project_modules(sorted: false)
- project_modules
- .reject { |name| disabled_project_modules.include? name }
- .tap do |modules|
- modules.sort_by! { |name| I18n.t(:"project_module_#{name}") } if sorted
- end
+ modules = project_modules - disabled_project_modules
+
+ modules.sort_by! { |name| I18n.t(:"project_module_#{name}") } if sorted
+
+ modules
end
def disabled_project_modules