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

Load patches in autoloader

Oliver Güntherea0356b4efcf
diff --git a/config/initializers/10-load_patches.rb b/config/initializers/10-load_patches.rb
index 5caab4bf3aa..9c99e96c3cd 100644
--- a/config/initializers/10-load_patches.rb
+++ b/config/initializers/10-load_patches.rb
@@ -26,10 +26,12 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-# Do not place any patches within this file. Add a file to lib/open_project/patches
-require 'open_project/patches'
+Rails.application.reloader.to_prepare do
+ # Do not place any patches within this file. Add a file to lib/open_project/patches
+ require 'open_project/patches'
-# Whatever ruby file is placed in lib/open_project/patches is required
-Dir.glob(File.expand_path('../../lib/open_project/patches/*.rb', __dir__)).each do |path|
- require path
+ # Whatever ruby file is placed in lib/open_project/patches is required
+ Dir.glob(File.expand_path('../../lib/open_project/patches/*.rb', __dir__)).each do |path|
+ require path
+ end
end