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 ...@@ -33,7 +33,7 @@ class Note < ActiveRecord::Base
participant :author participant :author
belongs_to :project belongs_to :project
belongs_to :noteable, polymorphic: true belongs_to :noteable, polymorphic: true, touch: true
belongs_to :author, class_name: "User" belongs_to :author, class_name: "User"
belongs_to :updated_by, class_name: "User" belongs_to :updated_by, class_name: "User"
......
...@@ -10,10 +10,7 @@ module Notes ...@@ -10,10 +10,7 @@ module Notes
# Skip system notes, like status changes and cross-references and awards # Skip system notes, like status changes and cross-references and awards
unless note.system || note.is_award unless note.system || note.is_award
event = event_service.leave_note(note, note.author) event_service.leave_note(note, note.author)
noteable = note.noteable
noteable.touch if event.commented? && noteable.respond_to?(:touch)
note.create_cross_references! note.create_cross_references!
execute_hooks(note) execute_hooks(note)
end 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