summaryrefslogtreecommitdiff
path: root/app/models/project_services/emails_on_push_service.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-12-17 12:42:40 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-12-17 12:42:40 +0200
commit86a8796b1322879d01e9cea8fb728458e0e328cb (patch)
tree4b35e22f09d2b64018cd8bd0ed039ad99794e3fa /app/models/project_services/emails_on_push_service.rb
parent5ac57305477ed90bf416b3c795516e9b9135bf5b (diff)
downloadgitlab-ce-86a8796b1322879d01e9cea8fb728458e0e328cb.tar.gz
Create EmailsOnPushService model
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/models/project_services/emails_on_push_service.rb')
-rw-r--r--app/models/project_services/emails_on_push_service.rb45
1 files changed, 45 insertions, 0 deletions
diff --git a/app/models/project_services/emails_on_push_service.rb b/app/models/project_services/emails_on_push_service.rb
new file mode 100644
index 00000000000..c01748a81b0
--- /dev/null
+++ b/app/models/project_services/emails_on_push_service.rb
@@ -0,0 +1,45 @@
+# == 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
+