Commit 55d098c9 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Fix initial status again

parent 16b9e289
......@@ -11,16 +11,14 @@ module Clusters
validates :cluster, presence: true
after_initialize :set_initial_status
def self.application_name
self.to_s.demodulize.underscore
end
def initial_status
if cluster&.platform_kubernetes_active?
:installable
else
:not_installable
end
def set_initial_status
self.status = 'installable' if cluster&.platform_kubernetes_active?
end
def name
......
......@@ -4,7 +4,7 @@ module Clusters
extend ActiveSupport::Concern
included do
state_machine :status, initial: ->(application) { application.initial_status } do
state_machine :status, initial: :not_installable do
state :not_installable, value: -2
state :errored, value: -1
state :installable, value: 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment