2017-08-24 07:01:33 -04:00
|
|
|
class ProjectAutoDevops < ActiveRecord::Base
|
|
|
|
belongs_to :project
|
2017-09-04 09:44:46 -04:00
|
|
|
|
2017-09-12 06:33:48 -04:00
|
|
|
scope :enabled, -> { where(enabled: true) }
|
|
|
|
scope :disabled, -> { where(enabled: false) }
|
|
|
|
|
2017-09-06 15:00:34 -04:00
|
|
|
validates :domain, allow_blank: true, hostname: { allow_numeric_hostname: true }
|
2017-09-06 12:57:07 -04:00
|
|
|
|
2017-09-16 09:02:37 -04:00
|
|
|
def has_domain?
|
|
|
|
domain.present?
|
|
|
|
end
|
|
|
|
|
2017-09-06 12:57:07 -04:00
|
|
|
def variables
|
|
|
|
variables = []
|
|
|
|
variables << { key: 'AUTO_DEVOPS_DOMAIN', value: domain, public: true } if domain.present?
|
|
|
|
variables
|
|
|
|
end
|
2017-08-24 07:01:33 -04:00
|
|
|
end
|