BigW Consortium Gitlab

project_auto_devops.rb 446 Bytes
Newer Older
1 2
class ProjectAutoDevops < ActiveRecord::Base
  belongs_to :project
3

4 5 6
  scope :enabled, -> { where(enabled: true) }
  scope :disabled, -> { where(enabled: false) }

7
  validates :domain, allow_blank: true, hostname: { allow_numeric_hostname: true }
8

9 10 11 12
  def has_domain?
    domain.present?
  end

13 14 15 16 17
  def variables
    variables = []
    variables << { key: 'AUTO_DEVOPS_DOMAIN', value: domain, public: true } if domain.present?
    variables
  end
18
end