summaryrefslogtreecommitdiff
path: root/app/services/issuable/common_system_notes_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/issuable/common_system_notes_service.rb')
-rw-r--r--app/services/issuable/common_system_notes_service.rb26
1 files changed, 15 insertions, 11 deletions
diff --git a/app/services/issuable/common_system_notes_service.rb b/app/services/issuable/common_system_notes_service.rb
index a170a4dcae2..846b881e819 100644
--- a/app/services/issuable/common_system_notes_service.rb
+++ b/app/services/issuable/common_system_notes_service.rb
@@ -7,20 +7,24 @@ module Issuable
def execute(issuable, old_labels: [], is_update: true)
@issuable = issuable
- if is_update
- if issuable.previous_changes.include?('title')
- create_title_change_note(issuable.previous_changes['title'].first)
+ # We disable touch so that created system notes do not update
+ # the noteable's updated_at field
+ ActiveRecord::Base.no_touching do
+ if is_update
+ if issuable.previous_changes.include?('title')
+ create_title_change_note(issuable.previous_changes['title'].first)
+ end
+
+ handle_description_change_note
+
+ handle_time_tracking_note if issuable.is_a?(TimeTrackable)
+ create_discussion_lock_note if issuable.previous_changes.include?('discussion_locked')
end
- handle_description_change_note
-
- handle_time_tracking_note if issuable.is_a?(TimeTrackable)
- create_discussion_lock_note if issuable.previous_changes.include?('discussion_locked')
+ create_due_date_note if issuable.previous_changes.include?('due_date')
+ create_milestone_note if issuable.previous_changes.include?('milestone_id')
+ create_labels_note(old_labels) if old_labels && issuable.labels != old_labels
end
-
- create_due_date_note if issuable.previous_changes.include?('due_date')
- create_milestone_note if issuable.previous_changes.include?('milestone_id')
- create_labels_note(old_labels) if old_labels && issuable.labels != old_labels
end
private