diff options
author | Rubén Dávila <rdavila84@gmail.com> | 2016-01-18 21:59:22 -0500 |
---|---|---|
committer | Rubén Dávila <rdavila84@gmail.com> | 2016-01-18 21:59:22 -0500 |
commit | 08c482b87ac08dbea533b931fabfb6939edc45ea (patch) | |
tree | 16654f46265ebeacd60273b6f4c86bbef5d9f845 | |
parent | 78754cb1c9ad3dce56dd8257e95fc9241746b9f9 (diff) | |
download | gitlab-ce-08c482b87ac08dbea533b931fabfb6939edc45ea.tar.gz |
Check if object respond to #touch before update.
-rw-r--r-- | app/services/notes/create_service.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/services/notes/create_service.rb b/app/services/notes/create_service.rb index ef98f0fd223..b39ebac1092 100644 --- a/app/services/notes/create_service.rb +++ b/app/services/notes/create_service.rb @@ -11,8 +11,9 @@ 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 - note.noteable.touch if event.commented? + noteable.touch if event.commented? && noteable.respond_to?(:touch) note.create_cross_references! execute_hooks(note) end |