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
Jérome Perrin
gitlab-ce
Commits
86a8796b
Commit
86a8796b
authored
Dec 17, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create EmailsOnPushService model
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
5ac57305
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
15 deletions
+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
No files found.
app/models/project.rb
View file @
86a8796b
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
require_relative
"project_services/assembla_service"
require_relative
"project_services/assembla_service"
require_relative
"project_services/campfire_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/flowdock_service"
require_relative
"project_services/gitlab_ci_service"
require_relative
"project_services/gitlab_ci_service"
require_relative
"project_services/hipchat_service"
require_relative
"project_services/hipchat_service"
...
@@ -55,6 +56,7 @@ class Project < ActiveRecord::Base
...
@@ -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
:last_event
,
->
{
order
'events.created_at DESC'
},
class_name:
'Event'
,
foreign_key:
'project_id'
has_one
:gitlab_ci_service
,
dependent: :destroy
has_one
:gitlab_ci_service
,
dependent: :destroy
has_one
:campfire_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
:pivotaltracker_service
,
dependent: :destroy
has_one
:hipchat_service
,
dependent: :destroy
has_one
:hipchat_service
,
dependent: :destroy
has_one
:flowdock_service
,
dependent: :destroy
has_one
:flowdock_service
,
dependent: :destroy
...
@@ -244,7 +246,7 @@ class Project < ActiveRecord::Base
...
@@ -244,7 +246,7 @@ class Project < ActiveRecord::Base
end
end
def
available_services_names
def
available_services_names
%w(gitlab_ci campfire hipchat pivotaltracker flowdock assembla)
%w(gitlab_ci campfire hipchat pivotaltracker flowdock assembla
emails_on_push
)
end
end
def
gitlab_ci?
def
gitlab_ci?
...
...
app/models/project_services/emails_on_push_service.rb
0 → 100644
View file @
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
View file @
86a8796b
class
AddRecipientsToService
<
ActiveRecord
::
Migration
def
change
add_column
:services
,
:recipients
,
:text
end
end
db/schema.rb
View file @
86a8796b
...
@@ -11,7 +11,10 @@
...
@@ -11,7 +11,10 @@
#
#
# It's strongly recommended that you check this file into your version control system.
# 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
|
create_table
"broadcast_messages"
,
force:
true
do
|
t
|
t
.
text
"message"
,
null:
false
t
.
text
"message"
,
null:
false
...
@@ -94,20 +97,20 @@ ActiveRecord::Schema.define(version: 20131214224427) do
...
@@ -94,20 +97,20 @@ ActiveRecord::Schema.define(version: 20131214224427) do
add_index
"keys"
,
[
"user_id"
],
name:
"index_keys_on_user_id"
,
using: :btree
add_index
"keys"
,
[
"user_id"
],
name:
"index_keys_on_user_id"
,
using: :btree
create_table
"merge_requests"
,
force:
true
do
|
t
|
create_table
"merge_requests"
,
force:
true
do
|
t
|
t
.
string
"target_branch"
,
null:
false
t
.
string
"target_branch"
,
null:
false
t
.
string
"source_branch"
,
null:
false
t
.
string
"source_branch"
,
null:
false
t
.
integer
"source_project_id"
,
null:
false
t
.
integer
"source_project_id"
,
null:
false
t
.
integer
"author_id"
t
.
integer
"author_id"
t
.
integer
"assignee_id"
t
.
integer
"assignee_id"
t
.
string
"title"
t
.
string
"title"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
text
"st_commits"
,
limit:
2147483647
t
.
text
"st_commits"
t
.
text
"st_diffs"
,
limit:
2147483647
t
.
text
"st_diffs"
t
.
integer
"milestone_id"
t
.
integer
"milestone_id"
t
.
string
"state"
t
.
string
"state"
t
.
string
"merge_status"
t
.
string
"merge_status"
t
.
integer
"target_project_id"
,
null:
false
t
.
integer
"target_project_id"
,
null:
false
t
.
integer
"iid"
t
.
integer
"iid"
t
.
text
"description"
t
.
text
"description"
end
end
...
@@ -219,20 +222,21 @@ ActiveRecord::Schema.define(version: 20131214224427) do
...
@@ -219,20 +222,21 @@ ActiveRecord::Schema.define(version: 20131214224427) do
t
.
string
"project_url"
t
.
string
"project_url"
t
.
string
"subdomain"
t
.
string
"subdomain"
t
.
string
"room"
t
.
string
"room"
t
.
text
"recipients"
end
end
add_index
"services"
,
[
"project_id"
],
name:
"index_services_on_project_id"
,
using: :btree
add_index
"services"
,
[
"project_id"
],
name:
"index_services_on_project_id"
,
using: :btree
create_table
"snippets"
,
force:
true
do
|
t
|
create_table
"snippets"
,
force:
true
do
|
t
|
t
.
string
"title"
t
.
string
"title"
t
.
text
"content"
,
limit:
2147483647
t
.
text
"content"
t
.
integer
"author_id"
,
null:
false
t
.
integer
"author_id"
,
null:
false
t
.
integer
"project_id"
t
.
integer
"project_id"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
string
"file_name"
t
.
string
"file_name"
t
.
datetime
"expires_at"
t
.
datetime
"expires_at"
t
.
boolean
"private"
,
default:
true
,
null:
false
t
.
boolean
"private"
,
default:
true
,
null:
false
t
.
string
"type"
t
.
string
"type"
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