summaryrefslogtreecommitdiff
path: root/app/models/note.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-06-29 16:19:09 -0500
committermicael.bergeron <micaelbergeron@gmail.com>2017-12-07 09:01:19 -0500
commite4eba908cd85c3ad7b9861c3edbd3c81623242a0 (patch)
tree51704b1351f78fcd3de4a59399b10c5c3f64d70d /app/models/note.rb
parent17542a7895f288b8e7bc92836039f4dcbb7c17d2 (diff)
downloadgitlab-ce-e4eba908cd85c3ad7b9861c3edbd3c81623242a0.tar.gz
Allow commenting on individual commits inside an MR
Diffstat (limited to 'app/models/note.rb')
-rw-r--r--app/models/note.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/note.rb b/app/models/note.rb
index 733bbbc013f..1357e75d907 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -230,10 +230,14 @@ class Note < ActiveRecord::Base
for_personal_snippet?
end
+ def commit
+ project.commit(commit_id) if commit_id.present?
+ end
+
# override to return commits, which are not active record
def noteable
if for_commit?
- @commit ||= project.commit(commit_id)
+ @commit ||= commit
else
super
end