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 same restriction aggregation model

Kabiru Mwenja47103e1f7f96
diff --git a/app/services/journals/create_service.rb b/app/services/journals/create_service.rb
index d0b18a409e4..8488d33c3a7 100644
--- a/app/services/journals/create_service.rb
+++ b/app/services/journals/create_service.rb
@@ -889,7 +889,7 @@ module Journals
same_user?(predecessor) &&
same_cause?(predecessor, cause) &&
only_one_note(predecessor, notes) &&
- unrestricted_journal?(restricted)
+ same_restriction(predecessor, restricted)
end
def aggregation_active?
@@ -904,8 +904,8 @@ module Journals
predecessor.notes.empty? || notes.empty?
end
- def unrestricted_journal?(restricted)
- !restricted
+ def same_restriction(predecessor, restricted)
+ predecessor.restricted == restricted
end
def same_user?(predecessor)