move activated? method to service
This commit is contained in:
parent
ce84e3f440
commit
d6036f08aa
3 changed files with 8 additions and 4 deletions
|
@ -23,10 +23,6 @@ class GitlabCiService < Service
|
|||
|
||||
after_save :compose_service_hook, if: :activated?
|
||||
|
||||
def activated?
|
||||
active
|
||||
end
|
||||
|
||||
def compose_service_hook
|
||||
hook = service_hook || build_service_hook
|
||||
hook.url = [project_url, "/build", "?token=#{token}"].join("")
|
||||
|
|
|
@ -20,4 +20,8 @@ class Service < ActiveRecord::Base
|
|||
has_one :service_hook
|
||||
|
||||
validates :project_id, presence: true
|
||||
|
||||
def activated?
|
||||
active
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue