Class: UffizziCore::Project

Inherits:
ApplicationRecord show all
Includes:
AASM, ProjectRepo, StateMachineConcern
Defined in:
app/models/uffizzi_core/project.rb

Instance Method Summary collapse

Instance Method Details

#active_deploymentsObject



54
55
56
# File 'app/models/uffizzi_core/project.rb', line 54

def active_deployments
  deployments.active
end

#after_disableObject



48
49
50
51
52
# File 'app/models/uffizzi_core/project.rb', line 48

def after_disable
  update(name: "#{name} deleted #{DateTime.current.strftime('%H:%M:%S-%m%d%Y')}")
  update(slug: "#{slug} deleted #{DateTime.current.strftime('%H:%M:%S-%m%d%Y')}")
  disable_deployments
end

#compose_fileObject



64
65
66
# File 'app/models/uffizzi_core/project.rb', line 64

def compose_file
  compose_files.main.first
end

#disable_deploymentsObject



58
59
60
61
62
# File 'app/models/uffizzi_core/project.rb', line 58

def disable_deployments
  active_deployments.each do |deployment|
    UffizziCore::DeploymentService.disable!(deployment)
  end
end