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 `User.system` instead of `System.user` for migration journal user

Aaron Contrerase5f800212d69
diff --git a/db/migrate/20240116165933_add_derived_done_ratio_to_work_packages.rb b/db/migrate/20240116165933_add_derived_done_ratio_to_work_packages.rb
index a51279f234a..2e7427fc34e 100644
--- a/db/migrate/20240116165933_add_derived_done_ratio_to_work_packages.rb
+++ b/db/migrate/20240116165933_add_derived_done_ratio_to_work_packages.rb
@@ -58,7 +58,8 @@ class AddDerivedDoneRatioToWorkPackages < ActiveRecord::Migration[7.0]
WorkPackage.where.not(id: WorkPackage.leaves)
end
- # Sets the SystemUser as the author of the Journal
- # entries generated by this migration
- def journal_user = SystemUser.first
+ # Sets the system user as the author of the Journal
+ # entries generated by this migration. Creates the system
+ # user if it doesn't already exist.
+ def journal_user = User.system
end