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

Remove unnecessary path loading config. Fix module naming for Constraints::Enterprise.

Dombi Attila8555eb6ce200
diff --git a/config/application.rb b/config/application.rb
index 1d4a8d9ceb7..3c92d6857a3 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -113,10 +113,6 @@ module OpenProject
# http://stackoverflow.com/questions/4590229
config.middleware.use Rack::TempfileReaper
- # Custom directories with classes and modules you want to be autoloadable.
- config.paths.add Rails.root.join('lib').to_s, eager_load: true
- config.paths.add Rails.root.join('lib/constraints').to_s, eager_load: true
-
# Add lookbook preview paths when enabled
if OpenProject::Configuration.lookbook_enabled?
config.paths.add Primer::ViewComponents::Engine.root.join('app/components').to_s, eager_load: true
diff --git a/config/routes.rb b/config/routes.rb
index 1b94aa3b4f0..11de0c2a584 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -354,7 +354,7 @@ Rails.application.routes.draw do
scope 'admin' do
resource :announcements, only: %i[edit update]
- constraints(Enterprise) do
+ constraints(Constraints::Enterprise) do
resource :enterprise, only: %i[show create destroy]
scope controller: 'enterprises' do
post 'enterprise/save_trial_key' => 'enterprises#save_trial_key'
diff --git a/lib/constraints/enterprise.rb b/lib/constraints/enterprise.rb
index ff7a856fe0c..181869481a2 100644
--- a/lib/constraints/enterprise.rb
+++ b/lib/constraints/enterprise.rb
@@ -26,10 +26,12 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-module Enterprise
- module_function
+module Constraints
+ module Enterprise
+ module_function
- def matches?(_request)
- OpenProject::Configuration.ee_manager_visible?
+ def matches?(_request)
+ OpenProject::Configuration.ee_manager_visible?
+ end
end
end