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
extract journable_id
Ivan Kuchin95bc020d2308
diff --git a/app/services/journals/create_service.rb b/app/services/journals/create_service.rbindex 96509ac3e13..ec7add86b39 100644--- a/app/services/journals/create_service.rb+++ b/app/services/journals/create_service.rb@@ -62,6 +62,8 @@ module Journalsprivate+ def journable_id = journable.id+# If the journalizing happens within the configured aggregation time, is carried out by the same user, has an# identical cause and only the predecessor or the journal to be created has notes, the changes are aggregated.# Instead of removing the predecessor, return it here so that it can be stripped in the journal creating@@ -375,14 +377,14 @@ module Journalssanitize(sql,notes:,cause: cause_sql(cause),- journable_id: journable.id,+ journable_id:,journable_type:,user_id: user.id,data_type: journable.class.journal_class.name)enddef insert_data_sql(predecessor, notes, cause)- sanitize(<<~SQL, journable_id: journable.id)+ sanitize(<<~SQL, journable_id:)INSERT INTO#{data_table_name} (#{data_sink_columns}@@ -403,7 +405,7 @@ module Journalsenddef insert_attachable_sql- sanitize(<<~SQL, journable_id: journable.id, journable_class_name:)+ sanitize(<<~SQL, journable_id:, journable_class_name:)INSERT INTOattachable_journals (journal_id,@@ -423,7 +425,7 @@ module Journalsenddef insert_customizable_sql- sanitize(<<~SQL, journable_id: journable.id, journable_class_name:)+ sanitize(<<~SQL, journable_id:, journable_class_name:)INSERT INTOcustomizable_journals (journal_id,@@ -445,7 +447,7 @@ module Journalsenddef insert_storable_sql- sanitize(<<~SQL, journable_id: journable.id, journable_class_name:)+ sanitize(<<~SQL, journable_id:, journable_class_name:)INSERT INTOstorages_file_links_journals (journal_id,@@ -467,7 +469,7 @@ module Journalsenddef insert_agenda_itemable_sql- sanitize(<<~SQL, journable_id: journable.id)+ sanitize(<<~SQL, journable_id:)INSERT INTOmeeting_agenda_item_journals (journal_id,@@ -566,7 +568,7 @@ module Journalsenddef select_max_journal_sql(predecessor)- sanitize(<<~SQL, journable_id: journable.id, journable_type:)+ sanitize(<<~SQL, journable_id:, journable_type:)SELECT:journable_id journable_id,:journable_type journable_type,@@ -606,7 +608,7 @@ module Journalsenddef attachable_changes_sql- sanitize(<<~SQL, journable_id: journable.id, container_type: journable_class_name)+ sanitize(<<~SQL, journable_id:, container_type: journable_class_name)SELECTmax_journals.journable_idFROM@@ -628,7 +630,7 @@ module Journalsenddef customizable_changes_sql- sanitize(<<~SQL, journable_id: journable.id, customized_type: journable_class_name)+ sanitize(<<~SQL, journable_id:, customized_type: journable_class_name)SELECTmax_journals.journable_idFROM@@ -652,7 +654,7 @@ module Journalsenddef storable_changes_sql- sanitize(<<~SQL, journable_id: journable.id, container_type: journable_class_name)+ sanitize(<<~SQL, journable_id:, container_type: journable_class_name)SELECTmax_journals.journable_idFROM@@ -674,7 +676,7 @@ module Journalsenddef agenda_itemable_changes_sql- sanitize(<<~SQL, journable_id: journable.id)+ sanitize(<<~SQL, journable_id:)SELECTmax_journals.journable_idFROM@@ -704,7 +706,7 @@ module Journalsenddef data_changes_sql- sanitize(<<~SQL, journable_id: journable.id)+ sanitize(<<~SQL, journable_id:)SELECT#{journable_table_name}.id journable_idFROM@@ -732,12 +734,12 @@ module Journalsif predecessorsanitize "#{sql} AND version < :predecessor_version",- journable_id: journable.id,+ journable_id:,journable_type:,predecessor_version: predecessor.versionelsesanitize sql,- journable_id: journable.id,+ journable_id:,journable_type:endend