Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

enums hotfix for multitenancy

Markus Kahl90a8500e0f83
diff --git a/modules/storages/app/models/storages/project_storage.rb b/modules/storages/app/models/storages/project_storage.rb
index 34740da5907..3aa1f05ad66 100644
--- a/modules/storages/app/models/storages/project_storage.rb
+++ b/modules/storages/app/models/storages/project_storage.rb
@@ -40,6 +40,10 @@ class Storages::ProjectStorage < ApplicationRecord
# There should be only one ProjectStorage per project and storage.
validates :project, uniqueness: { scope: :storage }
+ # The enum type detection fails in the multitenancy context for unknown
+ # reasons. So we declare it explicitly here. @TODO remove once fixed properly
+ attribute :project_folder_mode, :string
+
enum project_folder_mode: {
inactive: 'inactive',
manual: 'manual',
diff --git a/modules/storages/app/models/storages/storage.rb b/modules/storages/app/models/storages/storage.rb
index cf8d21707dc..b2d2bc00a9d 100644
--- a/modules/storages/app/models/storages/storage.rb
+++ b/modules/storages/app/models/storages/storage.rb
@@ -82,6 +82,10 @@ module Storages
scope :automatic_management_enabled, -> { where("provider_fields->>'automatically_managed' = 'true'") }
+ # The enum type detection fails in the multitenancy context for unknown
+ # reasons. So we declare it explicitly here. @TODO remove once fixed properly
+ attribute :health_status, :string
+
enum health_status: {
pending: 'pending',
healthy: 'healthy',