diff options
Diffstat (limited to 'app/models')
| -rw-r--r-- | app/models/service.rb | 21 | ||||
| -rw-r--r-- | app/models/service_hook.rb | 15 |
2 files changed, 36 insertions, 0 deletions
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 |
