summaryrefslogtreecommitdiff
path: root/app/models/note.rb
diff options
context:
space:
mode:
authorRiyad Preukschas <riyad@informatik.uni-bremen.de>2012-10-10 12:06:30 +0200
committerRiyad Preukschas <riyad@informatik.uni-bremen.de>2012-10-10 12:06:30 +0200
commit3f72af9994554c66a51cdfb4302e48da0edd043a (patch)
tree9abd52eb69954b9921ac71f9b781f6f5f4639181 /app/models/note.rb
parentdda852a0d5c9e684b82cf20380d2b26da1798ecb (diff)
downloadgitlab-ce-3f72af9994554c66a51cdfb4302e48da0edd043a.tar.gz
Make notes for merge requests include commit notes and add helpers
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 65b20fe0b11..ae51e486675 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -49,7 +49,7 @@ class Note < ActiveRecord::Base
end
def target
- if noteable_type == "Commit"
+ if commit?
project.commit(noteable_id)
else
noteable
@@ -82,6 +82,10 @@ class Note < ActiveRecord::Base
noteable_type == "Commit"
end
+ def line_note?
+ line_code.present?
+ end
+
def commit_author
@commit_author ||=
project.users.find_by_email(target.author_email) ||