Update Issue/MR everytime a Note is saved/destroyed.
This commit is contained in:
parent
08c482b87a
commit
35a776754c
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue