Make notes for merge requests include commit notes and add helpers
This commit is contained in:
parent
dda852a0d5
commit
3f72af9994
4 changed files with 16 additions and 2 deletions
|
@ -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) ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue