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

This commit is contained in:
Rubén Dávila 2016-01-19 15:02:26 -05:00
parent 08c482b87a
commit 35a776754c
2 changed files with 2 additions and 5 deletions

View File

@ -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"

View File

@ -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