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

use to_prepare instead of after_initialize in acts_as_favorable/acts_as_watchable initializers

Ivan Kuchin2c2e907e1c52
diff --git a/config/initializers/acts_as_favorable.rb b/config/initializers/acts_as_favorable.rb
index ad8c5af37d9..a9826097a88 100644
--- a/config/initializers/acts_as_favorable.rb
+++ b/config/initializers/acts_as_favorable.rb
@@ -2,6 +2,6 @@
# For development and non-eager load mode, we need to load models using acts_as_favorable manually
# as no eager loading takes place
-Rails.application.config.after_initialize do
+Rails.application.config.to_prepare do
Project
end
diff --git a/config/initializers/acts_as_watchable.rb b/config/initializers/acts_as_watchable.rb
index a5cc8d83be3..65511efba16 100644
--- a/config/initializers/acts_as_watchable.rb
+++ b/config/initializers/acts_as_watchable.rb
@@ -2,7 +2,7 @@
# For development and non-eager load mode, we need to load models using acts_as_watchable manually
# as no eager loading takes place
-Rails.application.config.after_initialize do
+Rails.application.config.to_prepare do
Forum
Meeting
Message