summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-11-19 21:14:05 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-11-20 11:33:49 +0200
commitc3b074acab554fc40a8fcb6060ed7ab10e4171a4 (patch)
treeb524e4c96f998534522f2b4b4fea9994da8c6983 /app
parentbe1dc5544a7840d17657d3d8fcecb0d0fd4401b5 (diff)
downloadgitlab-ce-c3b074acab554fc40a8fcb6060ed7ab10e4171a4.tar.gz
Service model and service hook
Diffstat (limited to 'app')
-rw-r--r--app/assets/images/service-gitlab-ci.pngbin0 -> 2758 bytes
-rw-r--r--app/models/service.rb21
-rw-r--r--app/models/service_hook.rb15
3 files changed, 36 insertions, 0 deletions
diff --git a/app/assets/images/service-gitlab-ci.png b/app/assets/images/service-gitlab-ci.png
new file mode 100644
index 00000000000..afaa10d02b0
--- /dev/null
+++ b/app/assets/images/service-gitlab-ci.png
Binary files differ
diff --git a/app/models/service.rb b/app/models/service.rb
new file mode 100644
index 00000000000..b29f5089a1e
--- /dev/null
+++ b/app/models/service.rb
@@ -0,0 +1,21 @@
+# == 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
+#
+
+class Service < ActiveRecord::Base
+ attr_accessible :title, :token, :type
+
+ belongs_to :project
+ has_one :service_hook
+
+ validates :project_id, presence: true
+end
diff --git a/app/models/service_hook.rb b/app/models/service_hook.rb
new file mode 100644
index 00000000000..aedd0eef271
--- /dev/null
+++ b/app/models/service_hook.rb
@@ -0,0 +1,15 @@
+# == Schema Information
+#
+# Table name: web_hooks
+#
+# id :integer not null, primary key
+# url :string(255)
+# project_id :integer
+# created_at :datetime not null
+# updated_at :datetime not null
+# type :string(255) default("ProjectHook")
+#
+
+class ServiceHook < WebHook
+ belongs_to :service
+end