Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
86a8796b
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
86a8796b
编写于
12月 17, 2013
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Create EmailsOnPushService model
Signed-off-by:
N
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
上级
5ac57305
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
71 addition
and
15 deletion
+71
-15
app/models/project.rb
app/models/project.rb
+3
-1
app/models/project_services/emails_on_push_service.rb
app/models/project_services/emails_on_push_service.rb
+45
-0
db/migrate/20131217102743_add_recipients_to_service.rb
db/migrate/20131217102743_add_recipients_to_service.rb
+5
-0
db/schema.rb
db/schema.rb
+18
-14
未找到文件。
app/models/project.rb
浏览文件 @
86a8796b
...
...
@@ -25,6 +25,7 @@
require_relative
"project_services/assembla_service"
require_relative
"project_services/campfire_service"
require_relative
"project_services/emails_on_push_service"
require_relative
"project_services/flowdock_service"
require_relative
"project_services/gitlab_ci_service"
require_relative
"project_services/hipchat_service"
...
...
@@ -55,6 +56,7 @@ class Project < ActiveRecord::Base
has_one
:last_event
,
->
{
order
'events.created_at DESC'
},
class_name:
'Event'
,
foreign_key:
'project_id'
has_one
:gitlab_ci_service
,
dependent: :destroy
has_one
:campfire_service
,
dependent: :destroy
has_one
:emails_on_push_service
,
dependent: :destroy
has_one
:pivotaltracker_service
,
dependent: :destroy
has_one
:hipchat_service
,
dependent: :destroy
has_one
:flowdock_service
,
dependent: :destroy
...
...
@@ -244,7 +246,7 @@ class Project < ActiveRecord::Base
end
def
available_services_names
%w(gitlab_ci campfire hipchat pivotaltracker flowdock assembla)
%w(gitlab_ci campfire hipchat pivotaltracker flowdock assembla
emails_on_push
)
end
def
gitlab_ci?
...
...
app/models/project_services/emails_on_push_service.rb
0 → 100644
浏览文件 @
86a8796b
# == Schema Information
#
# Table name: services
#
# id :integer not null, primary key
# type :string(255)
# title :string(255)
# token :string(255)
# project_id :integer not null
# created_at :datetime not null
# updated_at :datetime not null
# active :boolean default(FALSE), not null
# project_url :string(255)
# subdomain :string(255)
# room :string(255)
#
class
EmailsOnPushService
<
Service
attr_accessible
:recipients
validates
:recipients
,
presence:
true
,
if: :activated?
def
title
'Emails on push'
end
def
description
'Send emails to recipients on push'
end
def
to_param
'emails_on_push'
end
def
execute
true
end
def
fields
[
{
type:
'textarea'
,
name:
'recipients'
,
placeholder:
'Recipients'
},
]
end
end
db/migrate/20131217102743_add_recipients_to_service.rb
0 → 100644
浏览文件 @
86a8796b
class
AddRecipientsToService
<
ActiveRecord
::
Migration
def
change
add_column
:services
,
:recipients
,
:text
end
end
db/schema.rb
浏览文件 @
86a8796b
...
...
@@ -11,7 +11,10 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
20131214224427
)
do
ActiveRecord
::
Schema
.
define
(
version:
20131217102743
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
create_table
"broadcast_messages"
,
force:
true
do
|
t
|
t
.
text
"message"
,
null:
false
...
...
@@ -94,20 +97,20 @@ ActiveRecord::Schema.define(version: 20131214224427) do
add_index
"keys"
,
[
"user_id"
],
name:
"index_keys_on_user_id"
,
using: :btree
create_table
"merge_requests"
,
force:
true
do
|
t
|
t
.
string
"target_branch"
,
null:
false
t
.
string
"source_branch"
,
null:
false
t
.
integer
"source_project_id"
,
null:
false
t
.
string
"target_branch"
,
null:
false
t
.
string
"source_branch"
,
null:
false
t
.
integer
"source_project_id"
,
null:
false
t
.
integer
"author_id"
t
.
integer
"assignee_id"
t
.
string
"title"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
text
"st_commits"
,
limit:
2147483647
t
.
text
"st_diffs"
,
limit:
2147483647
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
text
"st_commits"
t
.
text
"st_diffs"
t
.
integer
"milestone_id"
t
.
string
"state"
t
.
string
"merge_status"
t
.
integer
"target_project_id"
,
null:
false
t
.
integer
"target_project_id"
,
null:
false
t
.
integer
"iid"
t
.
text
"description"
end
...
...
@@ -219,20 +222,21 @@ ActiveRecord::Schema.define(version: 20131214224427) do
t
.
string
"project_url"
t
.
string
"subdomain"
t
.
string
"room"
t
.
text
"recipients"
end
add_index
"services"
,
[
"project_id"
],
name:
"index_services_on_project_id"
,
using: :btree
create_table
"snippets"
,
force:
true
do
|
t
|
t
.
string
"title"
t
.
text
"content"
,
limit:
2147483647
t
.
integer
"author_id"
,
null:
false
t
.
text
"content"
t
.
integer
"author_id"
,
null:
false
t
.
integer
"project_id"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
string
"file_name"
t
.
datetime
"expires_at"
t
.
boolean
"private"
,
default:
true
,
null:
false
t
.
boolean
"private"
,
default:
true
,
null:
false
t
.
string
"type"
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录