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
Léo-Paul Géneau
gitlab-ce
Commits
630e8790
Commit
630e8790
authored
Apr 17, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up code somewhat.
parent
990b476f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
26 deletions
+24
-26
app/models/commit.rb
app/models/commit.rb
+3
-4
app/models/concerns/issuable.rb
app/models/concerns/issuable.rb
+4
-5
app/models/snippet.rb
app/models/snippet.rb
+2
-4
app/services/projects/participants_service.rb
app/services/projects/participants_service.rb
+15
-13
No files found.
app/models/commit.rb
View file @
630e8790
...
@@ -139,15 +139,14 @@ class Commit
...
@@ -139,15 +139,14 @@ class Commit
users
<<
author
users
<<
author
users
<<
committer
users
<<
committer
mentions
=
[]
users
.
push
*
self
.
mentioned_users
(
current_user
,
project
)
mentions
<<
self
.
mentioned_users
(
current_user
,
project
)
notes
(
project
).
each
do
|
note
|
notes
(
project
).
each
do
|
note
|
users
<<
note
.
author
users
<<
note
.
author
mentions
<<
note
.
mentioned_users
(
current_user
,
project
)
users
.
push
*
note
.
mentioned_users
(
current_user
,
project
)
end
end
users
.
concat
(
mentions
.
reduce
([],
:|
)).
uniq
users
.
uniq
end
end
def
notes
(
project
)
def
notes
(
project
)
...
...
app/models/concerns/issuable.rb
View file @
630e8790
...
@@ -122,16 +122,15 @@ module Issuable
...
@@ -122,16 +122,15 @@ module Issuable
users
=
[]
users
=
[]
users
<<
author
users
<<
author
users
<<
assignee
if
is_assigned?
users
<<
assignee
if
is_assigned?
mentions
=
[]
users
.
push
*
self
.
mentioned_users
(
current_user
)
mentions
<<
self
.
mentioned_users
(
current_user
)
notes
.
each
do
|
note
|
notes
.
each
do
|
note
|
users
<<
note
.
author
users
<<
note
.
author
mentions
<<
note
.
mentioned_users
(
current_user
)
users
.
push
*
note
.
mentioned_users
(
current_user
)
end
end
users
.
concat
(
mentions
.
reduce
([],
:|
)).
uniq
users
.
uniq
end
end
def
subscribed?
(
user
)
def
subscribed?
(
user
)
...
...
app/models/snippet.rb
View file @
630e8790
...
@@ -90,15 +90,13 @@ class Snippet < ActiveRecord::Base
...
@@ -90,15 +90,13 @@ class Snippet < ActiveRecord::Base
def
participants
(
current_user
=
self
.
author
)
def
participants
(
current_user
=
self
.
author
)
users
=
[]
users
=
[]
users
<<
author
users
<<
author
mentions
=
[]
notes
.
each
do
|
note
|
notes
.
each
do
|
note
|
users
<<
note
.
author
users
<<
note
.
author
mentions
<<
note
.
mentioned_users
(
current_user
)
users
.
push
*
note
.
mentioned_users
(
current_user
)
end
end
users
.
concat
(
mentions
.
reduce
([],
:|
)).
uniq
users
.
uniq
end
end
class
<<
self
class
<<
self
...
...
app/services/projects/participants_service.rb
View file @
630e8790
...
@@ -13,19 +13,21 @@ module Projects
...
@@ -13,19 +13,21 @@ module Projects
end
end
def
participants_in
(
type
,
id
)
def
participants_in
(
type
,
id
)
users
=
case
type
users
=
when
"Issue"
case
type
issue
=
project
.
issues
.
find_by_iid
(
id
)
when
"Issue"
issue
?
issue
.
participants
(
current_user
)
:
[]
issue
=
project
.
issues
.
find_by_iid
(
id
)
when
"MergeRequest"
issue
.
participants
(
current_user
)
if
issue
merge_request
=
project
.
merge_requests
.
find_by_iid
(
id
)
when
"MergeRequest"
merge_request
?
merge_request
.
participants
(
current_user
)
:
[]
merge_request
=
project
.
merge_requests
.
find_by_iid
(
id
)
when
"Commit"
merge_request
.
participants
(
current_user
)
if
merge_request
commit
=
project
.
repository
.
commit
(
id
)
when
"Commit"
commit
?
commit
.
participants
(
project
,
current_user
)
:
[]
commit
=
project
.
repository
.
commit
(
id
)
else
commit
.
participants
(
project
,
current_user
)
if
commit
[]
end
end
return
[]
unless
users
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