diff options
author | micael.bergeron <micael.bergeron@solutionstlm.com> | 2017-07-27 23:38:52 +0300 |
---|---|---|
committer | micael.bergeron <micael.bergeron@solutionstlm.com> | 2017-09-06 16:00:57 +0300 |
commit | 5e600db21ce5d6544f559ea6d25aab2858dd465e (patch) | |
tree | 9f1d2232c47efb7c2731bc820652b59cf2ebd1f4 /app/helpers/notes_helper.rb | |
parent | b97f9629cabadca1125351a8aa514791524dea3f (diff) |
fix #35161, add a first-time contributor badge
a new badge will be added when an user that doesn't yet
have any merged merge request is discussing on either issues or
merge requests that he created.
this is indented for people to use extra care when discussing with
a new contributor.
Diffstat (limited to 'app/helpers/notes_helper.rb')
-rw-r--r-- | app/helpers/notes_helper.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/helpers/notes_helper.rb b/app/helpers/notes_helper.rb index 083ace65b09..1e7d346ab8f 100644 --- a/app/helpers/notes_helper.rb +++ b/app/helpers/notes_helper.rb @@ -76,6 +76,11 @@ module NotesHelper note.project.team.human_max_access(note.author_id) end + def note_first_contribution_for_user?(note) + note.noteable.author_id == note.author_id && + note.project.merge_requests.merged.where(author_id: note.author_id).empty? + end + def discussion_path(discussion) if discussion.for_merge_request? return unless discussion.diff_discussion? |