Skip to content
Snippets Groups Projects
Commit d2630221 authored by Marin Jankovski's avatar Marin Jankovski
Browse files

Correct identation, default value if note doesn't exist.

parent 12c3962f
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -126,10 +126,10 @@ class ProjectsController < ApplicationController
note_type = params['type']
note_id = params['type_id']
participating = if note_type && note_id
participants_in(note_type, note_id)
else
[]
end
participants_in(note_type, note_id)
else
[]
end
team_members = sorted(@project.team.members)
participants = team_members + participating
@suggestions = {
Loading
Loading
@@ -174,16 +174,18 @@ class ProjectsController < ApplicationController
 
def participants_in(type, id)
users = case type
when "Issue"
@project.issues.find_by_iid(id).participants
when "MergeRequest"
@project.merge_requests.find_by_iid(id).participants
when "Commit"
author_ids = Note.for_commit_id(id).pluck(:author_id).uniq
User.where(id: author_ids)
else
[]
end
when "Issue"
issue = @project.issues.find_by_iid(id)
issue ? issue.participants : []
when "MergeRequest"
merge_request = @project.merge_requests.find_by_iid(id)
merge_request ? merge_request.participants : []
when "Commit"
author_ids = Note.for_commit_id(id).pluck(:author_id).uniq
User.where(id: author_ids)
else
[]
end
sorted(users)
end
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment