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

refactor: put methods in the same order as in case statement

Christophe Bliarda32c41b97f98
diff --git a/lib/open_project/journal_formatter/cause.rb b/lib/open_project/journal_formatter/cause.rb
index 4040bcd3e61..77de14d4e41 100644
--- a/lib/open_project/journal_formatter/cause.rb
+++ b/lib/open_project/journal_formatter/cause.rb
@@ -73,20 +73,6 @@ class OpenProject::JournalFormatter::Cause < JournalFormatter::Base
I18n.t("journals.cause_descriptions.system_update.#{cause['feature']}")
end
- def related_work_package_changed_message(cause, html)
- related_work_package = WorkPackage.includes(:project).visible(User.current).find_by(id: cause["work_package_id"])
-
- if related_work_package
- I18n.t(
- "journals.cause_descriptions.#{cause['type']}",
- link: html ? link_to_work_package(related_work_package, all_link: true) : "##{related_work_package.id}"
- )
-
- else
- I18n.t("journals.cause_descriptions.unaccessable_work_package_changed")
- end
- end
-
def working_days_changed_message(changed_dates)
day_changes_messages = changed_dates["working_days"].collect do |day, working|
working_day_change_message(day.to_i, working)
@@ -108,6 +94,20 @@ class OpenProject::JournalFormatter::Cause < JournalFormatter::Base
date: I18n.l(Date.parse(date)))
end
+ def related_work_package_changed_message(cause, html)
+ related_work_package = WorkPackage.includes(:project).visible(User.current).find_by(id: cause["work_package_id"])
+
+ if related_work_package
+ I18n.t(
+ "journals.cause_descriptions.#{cause['type']}",
+ link: html ? link_to_work_package(related_work_package, all_link: true) : "##{related_work_package.id}"
+ )
+
+ else
+ I18n.t("journals.cause_descriptions.unaccessable_work_package_changed")
+ end
+ end
+
# we need to tell the url_helper that there is not controller to get url_options
# so that we can later call link_to
def controller