From 44f274b8d94e2fdcf4f948f0b837d75a95212d74 Mon Sep 17 00:00:00 2001 From: Lidia Mokevnina Date: Thu, 19 Jan 2023 18:29:21 +0100 Subject: [PATCH 1/2] [362] added compose file kinds to uffiizzi_core --- core/app/lib/uffizzi_core/concerns/models/compose_file.rb | 2 +- core/lib/uffizzi_core.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/app/lib/uffizzi_core/concerns/models/compose_file.rb b/core/app/lib/uffizzi_core/concerns/models/compose_file.rb index ff5e82a1..a8429584 100644 --- a/core/app/lib/uffizzi_core/concerns/models/compose_file.rb +++ b/core/app/lib/uffizzi_core/concerns/models/compose_file.rb @@ -20,7 +20,7 @@ module UffizziCore::Concerns::Models::ComposeFile has_many :host_volume_files, dependent: :destroy has_many :deployments, dependent: :nullify - enumerize :kind, in: [:main, :temporary], predicates: true, scope: :shallow, default: :main + enumerize :kind, in: UffizziCore.compose_file_kinds, predicates: true, scope: :shallow, default: :main validates :source, presence: true validate :main_compose_file_uniqueness, on: :create, if: -> { kind.main? } diff --git a/core/lib/uffizzi_core.rb b/core/lib/uffizzi_core.rb index 64e5df60..41eae507 100644 --- a/core/lib/uffizzi_core.rb +++ b/core/lib/uffizzi_core.rb @@ -64,4 +64,5 @@ module UffizziCore mattr_accessor :user_creation_sources, default: [:system, :online_registration, :google, :sso] mattr_accessor :user_project_roles, default: [:admin, :developer, :viewer] mattr_accessor :account_sources, default: [:manual] + mattr_accessor :compose_file_kinds, default: [:main, :temporary] end From 037f2a04cf4f565c7afc5a7928984ce1df4dbad7 Mon Sep 17 00:00:00 2001 From: Lidia Mokevnina Date: Thu, 19 Jan 2023 19:00:53 +0100 Subject: [PATCH 2/2] [362] added demo creation_source to deployments --- core/app/lib/uffizzi_core/concerns/models/deployment.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/app/lib/uffizzi_core/concerns/models/deployment.rb b/core/app/lib/uffizzi_core/concerns/models/deployment.rb index 00549de6..3a76e27b 100644 --- a/core/app/lib/uffizzi_core/concerns/models/deployment.rb +++ b/core/app/lib/uffizzi_core/concerns/models/deployment.rb @@ -27,7 +27,7 @@ module UffizziCore::Concerns::Models::Deployment validates :kind, presence: true - enumerize :creation_source, in: [:manual, :continuous_preview, :compose_file_manual, :compose_file_continuous_preview], + enumerize :creation_source, in: [:manual, :demo, :continuous_preview, :compose_file_manual, :compose_file_continuous_preview], predicates: true, scope: true, default: :manual accepts_nested_attributes_for :containers, allow_destroy: true