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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Revert "save sql request by differentiating between create and update"
ulfertsf99cf9424955
diff --git a/lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/save_hooks.rb b/lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/save_hooks.rbindex 6802b946e20..fe5e6eda407 100644--- a/lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/save_hooks.rb+++ b/lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/save_hooks.rb@@ -55,8 +55,7 @@ module Redmine::Acts::Journalizedbase.extend ClassMethodsbase.class_eval do- after_create { save_journals(true) }- after_update { save_journals }+ after_save :save_journalsafter_destroy :remove_journal_versionattr_accessor :journal_notes, :journal_user@@ -69,18 +68,20 @@ module Redmine::Acts::Journalized.delete_allend- def save_journals(force = false)+ def save_journalswith_ensured_journal_attributes do- if force || JournalManager.changed?(self) || !@journal_notes.empty?+ add_journal = journals.empty? || JournalManager.changed?(self) || !@journal_notes.empty?++ if add_journaljournal = JournalManager.add_journal!(self, @journal_user, @journal_notes)OpenProject::Notifications.send('journal_created',journal: journal,send_notification: JournalManager.send_notification)- end- # Need to clear the notification setting after each usage otherwise it might be cached- JournalManager.reset_notification+ # Need to clear the notification setting after each usage otherwise it might be cached+ JournalManager.reset_notification+ endendend