From b13a6d72c44f20bf13df89de248554d0b9794443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Ig=C3=B3n?= Date: Mon, 28 Oct 2024 16:24:12 +0100 Subject: [PATCH] add the cache_classes field to the initializer of a new app to be used with secrets --- .../lib/decidim/generators/app_templates/initializer.rb | 3 +++ .../lib/decidim/generators/app_templates/secrets.yml.erb | 1 + 2 files changed, 4 insertions(+) diff --git a/decidim-generators/lib/decidim/generators/app_templates/initializer.rb b/decidim-generators/lib/decidim/generators/app_templates/initializer.rb index 3034231ff73a0..75a619e20306d 100644 --- a/decidim-generators/lib/decidim/generators/app_templates/initializer.rb +++ b/decidim-generators/lib/decidim/generators/app_templates/initializer.rb @@ -21,6 +21,9 @@ # this value for that specific organization. config.default_locale = Rails.application.secrets.decidim[:default_locale].presence || :en + # Enable the cache classes configuration. + config.cache_classes = Rails.application.secrets.decidim[:cache_classes].presence || true + # Restrict access to the system part with an authorized ip list. # You can use a single ip like ("1.2.3.4"), or an ip subnet like ("1.2.3.4/24") # You may specify multiple ip in an array ["1.2.3.4", "1.2.3.4/24"] diff --git a/decidim-generators/lib/decidim/generators/app_templates/secrets.yml.erb b/decidim-generators/lib/decidim/generators/app_templates/secrets.yml.erb index 826182411e218..0dcd8be2305f7 100644 --- a/decidim-generators/lib/decidim/generators/app_templates/secrets.yml.erb +++ b/decidim-generators/lib/decidim/generators/app_templates/secrets.yml.erb @@ -32,6 +32,7 @@ decidim_default: &decidim_default base_uploads_path: <%%= Decidim::Env.new("DECIDIM_BASE_UPLOADS_PATH").to_json %> default_csv_col_sep: <%%= Decidim::Env.new("DECIDIM_DEFAULT_CSV_COL_SEP", ";").to_json %> consent_cookie_name: <%%= Decidim::Env.new("DECIDIM_CONSENT_COOKIE_NAME", "decidim-consent").to_json %> + cache_classes: <%%= Decidim::Env.new("DECIDIM_CACHE_CLASSES", "true").to_boolean_string %> cache_key_separator: <%%= Decidim::Env.new("DECIDIM_CACHE_KEY_SEPARATOR", "/").to_json %> cache_expiry_time: <%%= Decidim::Env.new("DECIDIM_CACHE_EXPIRATION_TIME", "1440").to_i %> stats_cache_expiry_time: <%%= Decidim::Env.new("DECIDIM_STATS_CACHE_EXPIRATION_TIME", 10).to_i %>