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
use ruby time
ulferts76527d46d26e
diff --git a/app/services/journals/create_service.rb b/app/services/journals/create_service.rbindex 4a050e6458d..43ff84ac4cc 100644--- a/app/services/journals/create_service.rb+++ b/app/services/journals/create_service.rb@@ -228,7 +228,7 @@ module JournalsjournalsSETnotes = :notes,- updated_at = #{journal_timestamp_sql(notes, ':updated_at')},+ updated_at = #{timestamp_sql},data_id = insert_data.idFROM insert_dataWHERE journals.id = :predecessor_id@@ -238,7 +238,6 @@ module Journalssanitize(journal_sql,notes: notes.presence || predecessor.notes,- updated_at: journable_timestamp,predecessor_id: predecessor.id)end@@ -568,10 +567,17 @@ module Journalsif notes.blank? && journable_timestampattributeelse- 'now()'+ timestamp_sqlendend+ def timestamp_sql+ # Use the ruby time instead of the DB's. If those are out of sync,+ # a journal might otherwise end up having an updated_at before created_at which+ # will also reflect back to the journaled object.+ "'#{Time.zone.now}'"+ end+# Because we added the journal via bare metal sql, rails does not yet# know of the journal. If the journable has the journals loaded already,# the caller might expect the journals to also be updated so we do it for him.