Commit 35a77675 authored by Rubén Dávila's avatar Rubén Dávila

Update Issue/MR everytime a Note is saved/destroyed.

parent 08c482b8
......@@ -33,7 +33,7 @@ class Note < ActiveRecord::Base
participant :author
belongs_to :project
belongs_to :noteable, polymorphic: true
belongs_to :noteable, polymorphic: true, touch: true
belongs_to :author, class_name: "User"
belongs_to :updated_by, class_name: "User"
......
......@@ -10,10 +10,7 @@ module Notes
# Skip system notes, like status changes and cross-references and awards
unless note.system || note.is_award
event = event_service.leave_note(note, note.author)
noteable = note.noteable
noteable.touch if event.commented? && noteable.respond_to?(:touch)
event_service.leave_note(note, note.author)
note.create_cross_references!
execute_hooks(note)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment