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
...
@@ -126,10 +126,10 @@ class ProjectsController < ApplicationController
note_type
=
params
[
'type'
]
note_type
=
params
[
'type'
]
note_id
=
params
[
'type_id'
]
note_id
=
params
[
'type_id'
]
participating
=
if
note_type
&&
note_id
participating
=
if
note_type
&&
note_id
participants_in
(
note_type
,
note_id
)
participants_in
(
note_type
,
note_id
)
else
else
[]
[]
end
end
team_members
=
sorted
(
@project
.
team
.
members
)
team_members
=
sorted
(
@project
.
team
.
members
)
participants
=
team_members
+
participating
participants
=
team_members
+
participating
@suggestions
=
{
@suggestions
=
{
...
@@ -174,16 +174,18 @@ class ProjectsController < ApplicationController
...
@@ -174,16 +174,18 @@ class ProjectsController < ApplicationController
def
participants_in
(
type
,
id
)
def
participants_in
(
type
,
id
)
users
=
case
type
users
=
case
type
when
"Issue"
when
"Issue"
@project
.
issues
.
find_by_iid
(
id
).
participants
issue
=
@project
.
issues
.
find_by_iid
(
id
)
when
"MergeRequest"
issue
?
issue
.
participants
:
[]
@project
.
merge_requests
.
find_by_iid
(
id
).
participants
when
"MergeRequest"
when
"Commit"
merge_request
=
@project
.
merge_requests
.
find_by_iid
(
id
)
author_ids
=
Note
.
for_commit_id
(
id
).
pluck
(
:author_id
).
uniq
merge_request
?
merge_request
.
participants
:
[]
User
.
where
(
id:
author_ids
)
when
"Commit"
else
author_ids
=
Note
.
for_commit_id
(
id
).
pluck
(
:author_id
).
uniq
[]
User
.
where
(
id:
author_ids
)
end
else
[]
end
sorted
(
users
)
sorted
(
users
)
end
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