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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
use cache_key_with_version to adapt to changed cache_key method
ulferts8018cc060b32
diff --git a/app/models/query.rb b/app/models/query.rbindex 47eabd5b19d..4464c41d803 100644--- a/app/models/query.rb+++ b/app/models/query.rb@@ -211,11 +211,11 @@ class Query < ApplicationRecorddef available_columnsif @available_columns &&- (@available_columns_project == (project&.cache_key || 0))+ (@available_columns_project == (project&.cache_key_with_version || 0))return @available_columnsend- @available_columns_project = project&.cache_key || 0+ @available_columns_project = project&.cache_key_with_version || 0@available_columns = ::Query.available_columns(project)enddiff --git a/lib/api/v3/queries/columns/query_relation_to_type_column_representer.rb b/lib/api/v3/queries/columns/query_relation_to_type_column_representer.rbindex 53a4255c9cd..db62ccf4e0e 100644--- a/lib/api/v3/queries/columns/query_relation_to_type_column_representer.rb+++ b/lib/api/v3/queries/columns/query_relation_to_type_column_representer.rb@@ -43,7 +43,7 @@ module APIenddef json_cache_key- [represented.name, represented.type.cache_key]+ [represented.name, represented.type.cache_key_with_version]endendenddiff --git a/lib/api/v3/queries/schemas/custom_field_json_cache_key_mixin.rb b/lib/api/v3/queries/schemas/custom_field_json_cache_key_mixin.rbindex 34acd010b8c..1448e3c3891 100644--- a/lib/api/v3/queries/schemas/custom_field_json_cache_key_mixin.rb+++ b/lib/api/v3/queries/schemas/custom_field_json_cache_key_mixin.rb@@ -36,7 +36,7 @@ module APIalias :orig_json_cache_key :json_cache_keydef json_cache_key- orig_json_cache_key + [filter.custom_field.cache_key]+ orig_json_cache_key + [filter.custom_field.cache_key_with_version]endendenddiff --git a/modules/auth_saml/lib/open_project/auth_saml/engine.rb b/modules/auth_saml/lib/open_project/auth_saml/engine.rbindex 455ac439112..ea3dafc4dde 100644--- a/modules/auth_saml/lib/open_project/auth_saml/engine.rb+++ b/modules/auth_saml/lib/open_project/auth_saml/engine.rb@@ -4,7 +4,7 @@ module OpenProjectdef self.configurationproviders = Saml::Provider.where(available: true)- OpenProject::Cache.fetch(providers.cache_key) do+ OpenProject::Cache.fetch(providers.cache_key_with_version) doproviders.each_with_object({}) do |provider, hash|hash[provider.slug.to_sym] = provider.to_henddiff --git a/modules/openid_connect/lib/open_project/openid_connect.rb b/modules/openid_connect/lib/open_project/openid_connect.rbindex 2c8df881e6c..c6c5cec912a 100644--- a/modules/openid_connect/lib/open_project/openid_connect.rb+++ b/modules/openid_connect/lib/open_project/openid_connect.rb@@ -7,7 +7,7 @@ module OpenProjectdef self.configurationproviders = ::OpenIDConnect::Provider.where(available: true)- OpenProject::Cache.fetch(providers.cache_key) do+ OpenProject::Cache.fetch(providers.cache_key_with_version) doproviders.each_with_object({}) do |provider, hash|hash[provider.slug.to_sym] = provider.to_henddiff --git a/spec/models/issue_priority_spec.rb b/spec/models/issue_priority_spec.rbindex 6371173082c..ab1f9c389bf 100644--- a/spec/models/issue_priority_spec.rb+++ b/spec/models/issue_priority_spec.rb@@ -64,13 +64,13 @@ RSpec.describe IssuePriority doendend- describe "#cache_key" do+ describe "#cache_key_with_version" doit "updates when the updated_at field changes" do- old_cache_key = stubbed_priority.cache_key+ old_cache_key = stubbed_priority.cache_key_with_version- stubbed_priority.updated_at = Time.now+ stubbed_priority.updated_at = Time.zone.now- expect(stubbed_priority.cache_key)+ expect(stubbed_priority.cache_key_with_version).not_to eql old_cache_keyendenddiff --git a/spec/models/status_spec.rb b/spec/models/status_spec.rbindex a21e3d9b286..a41527f63f5 100644--- a/spec/models/status_spec.rb+++ b/spec/models/status_spec.rb@@ -86,13 +86,13 @@ RSpec.describe Status doendend- describe "#cache_key" do+ describe "#cache_key_with_version" doit "updates when the updated_at field changes" do- old_cache_key = stubbed_status.cache_key+ old_cache_key = stubbed_status.cache_key_with_versionstubbed_status.updated_at = Time.zone.now- expect(stubbed_status.cache_key)+ expect(stubbed_status.cache_key_with_version).not_to eql old_cache_keyendend