Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
d2630221
Commit
d2630221
authored
Mar 25, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct identation, default value if note doesn't exist.
parent
12c3962f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
14 deletions
+16
-14
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+16
-14
No files found.
app/controllers/projects_controller.rb
View file @
d2630221
...
...
@@ -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
=
{
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment