Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
630e8790
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
630e8790
编写于
4月 17, 2015
作者:
D
Douwe Maan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clean up code somewhat.
上级
990b476f
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
24 addition
and
26 deletion
+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
未找到文件。
app/models/commit.rb
浏览文件 @
630e8790
...
...
@@ -139,15 +139,14 @@ class Commit
users
<<
author
users
<<
committer
mentions
=
[]
mentions
<<
self
.
mentioned_users
(
current_user
,
project
)
users
.
push
*
self
.
mentioned_users
(
current_user
,
project
)
notes
(
project
).
each
do
|
note
|
users
<<
note
.
author
mentions
<<
note
.
mentioned_users
(
current_user
,
project
)
users
.
push
*
note
.
mentioned_users
(
current_user
,
project
)
end
users
.
concat
(
mentions
.
reduce
([],
:|
)).
uniq
users
.
uniq
end
def
notes
(
project
)
...
...
app/models/concerns/issuable.rb
浏览文件 @
630e8790
...
...
@@ -123,15 +123,14 @@ module Issuable
users
<<
author
users
<<
assignee
if
is_assigned?
mentions
=
[]
mentions
<<
self
.
mentioned_users
(
current_user
)
users
.
push
*
self
.
mentioned_users
(
current_user
)
notes
.
each
do
|
note
|
users
<<
note
.
author
mentions
<<
note
.
mentioned_users
(
current_user
)
users
.
push
*
note
.
mentioned_users
(
current_user
)
end
users
.
concat
(
mentions
.
reduce
([],
:|
)).
uniq
users
.
uniq
end
def
subscribed?
(
user
)
...
...
app/models/snippet.rb
浏览文件 @
630e8790
...
...
@@ -91,14 +91,12 @@ class Snippet < ActiveRecord::Base
users
=
[]
users
<<
author
mentions
=
[]
notes
.
each
do
|
note
|
users
<<
note
.
author
mentions
<<
note
.
mentioned_users
(
current_user
)
users
.
push
*
note
.
mentioned_users
(
current_user
)
end
users
.
concat
(
mentions
.
reduce
([],
:|
)).
uniq
users
.
uniq
end
class
<<
self
...
...
app/services/projects/participants_service.rb
浏览文件 @
630e8790
...
...
@@ -13,19 +13,21 @@ module Projects
end
def
participants_in
(
type
,
id
)
users
=
case
type
users
=
case
type
when
"Issue"
issue
=
project
.
issues
.
find_by_iid
(
id
)
issue
?
issue
.
participants
(
current_user
)
:
[]
issue
.
participants
(
current_user
)
if
issue
when
"MergeRequest"
merge_request
=
project
.
merge_requests
.
find_by_iid
(
id
)
merge_request
?
merge_request
.
participants
(
current_user
)
:
[]
merge_request
.
participants
(
current_user
)
if
merge_request
when
"Commit"
commit
=
project
.
repository
.
commit
(
id
)
commit
?
commit
.
participants
(
project
,
current_user
)
:
[]
else
[]
commit
.
participants
(
project
,
current_user
)
if
commit
end
return
[]
unless
users
sorted
(
users
)
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录