diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-11-07 13:55:21 +0100 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-11-07 13:56:09 +0100 |
commit | f96b5eae20dbba3c2ce79556c4a9b034a590ee39 (patch) | |
tree | c76fd634720378fcf70ee959dc2e276292192c62 /app/models/clusters/applications/ingress.rb | |
parent | a906752d7f585c3122f47404e3f80f098e5bf223 (diff) | |
download | gitlab-ce-f96b5eae20dbba3c2ce79556c4a9b034a590ee39.tar.gz |
Fix initial_status
Diffstat (limited to 'app/models/clusters/applications/ingress.rb')
-rw-r--r-- | app/models/clusters/applications/ingress.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/models/clusters/applications/ingress.rb b/app/models/clusters/applications/ingress.rb index 8cb1ed68de9..c97e9db925e 100644 --- a/app/models/clusters/applications/ingress.rb +++ b/app/models/clusters/applications/ingress.rb @@ -9,8 +9,6 @@ module Clusters validates :cluster, presence: true - after_initialize :set_initial_status - default_value_for :ingress_type, :nginx default_value_for :version, :nginx @@ -22,8 +20,12 @@ module Clusters self.to_s.demodulize.underscore end - def set_initial_status - self.status = 0 unless cluster.application_helm_installed? + def initial_status + if cluster&.application_helm_installed? + :installable + else + :not_installable + end end def name |