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 initializer, not in individual patches

Oliver Günther2d902749d28e
diff --git a/config/initializers/10-load_patches.rb b/config/initializers/10-load_patches.rb
index e5f49a1bcda..c988e1c2093 100644
--- a/config/initializers/10-load_patches.rb
+++ b/config/initializers/10-load_patches.rb
@@ -29,6 +29,7 @@
#++
# 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|
diff --git a/lib/open_project/patches/carrierwave_sanitized_file.rb b/lib/open_project/patches/carrierwave_sanitized_file.rb
index 12e5434eefe..c2b05850b30 100644
--- a/lib/open_project/patches/carrierwave_sanitized_file.rb
+++ b/lib/open_project/patches/carrierwave_sanitized_file.rb
@@ -1,5 +1,4 @@
require 'carrierwave/storage/fog'
-require 'open_project/patches'
##
# Code copied straight from the CarrierWave source.
diff --git a/lib/open_project/patches/i18n_reject_empty_string.rb b/lib/open_project/patches/i18n_reject_empty_string.rb
index 9c74737f481..bd5b1013b73 100644
--- a/lib/open_project/patches/i18n_reject_empty_string.rb
+++ b/lib/open_project/patches/i18n_reject_empty_string.rb
@@ -25,7 +25,6 @@
#
# See docs/COPYRIGHT.rdoc for more details.
#++
-require 'open_project/patches'
module OpenProject
module Patches