Refactoring of hook functionality & bootsrap system hooks
This commit is contained in:
parent
72a571724d
commit
65dc68b35c
9 changed files with 24 additions and 14 deletions
|
@ -19,7 +19,7 @@ class Project < ActiveRecord::Base
|
|||
has_many :notes, :dependent => :destroy
|
||||
has_many :snippets, :dependent => :destroy
|
||||
has_many :deploy_keys, :dependent => :destroy, :foreign_key => "project_id", :class_name => "Key"
|
||||
has_many :web_hooks, :dependent => :destroy
|
||||
has_many :hooks, :dependent => :destroy, :class_name => "ProjectHook"
|
||||
has_many :wikis, :dependent => :destroy
|
||||
has_many :protected_branches, :dependent => :destroy
|
||||
|
||||
|
|
3
app/models/project_hook.rb
Normal file
3
app/models/project_hook.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
class ProjectHook < WebHook
|
||||
belongs_to :project
|
||||
end
|
3
app/models/system_hook.rb
Normal file
3
app/models/system_hook.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
class SystemHook < WebHook
|
||||
|
||||
end
|
|
@ -4,8 +4,6 @@ class WebHook < ActiveRecord::Base
|
|||
# HTTParty timeout
|
||||
default_timeout 10
|
||||
|
||||
belongs_to :project
|
||||
|
||||
validates :url,
|
||||
presence: true,
|
||||
format: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue