From 99b1453dba28e8fbe79cb1f87b2847e0129bce69 Mon Sep 17 00:00:00 2001 From: Quentin Champenois Date: Fri, 8 Nov 2024 16:06:45 +0100 Subject: [PATCH] fix: Allow to configure feat using env var --- .env-example | 4 +++- config/initializers/decidim_awesome.rb | 2 +- config/secrets.yml | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.env-example b/.env-example index d4139515..f9aad2e4 100644 --- a/.env-example +++ b/.env-example @@ -19,4 +19,6 @@ FRIENDLY_SIGNUP_USE_CONFIRMATION_CODES=1 DECIDIM_SESSION_TIMEOUT= # SKIP_FIRST_LOGIN_AUTHORIZATION=true -# RAILS_LOG_LEVEL=warn \ No newline at end of file +# RAILS_LOG_LEVEL=warn + +# DECIDIM_AWESOME_WEIGHTED_PROPOSAL_VOTING_ENABLED=disabled # or enabled \ No newline at end of file diff --git a/config/initializers/decidim_awesome.rb b/config/initializers/decidim_awesome.rb index 7bf5291f..24a30cdb 100644 --- a/config/initializers/decidim_awesome.rb +++ b/config/initializers/decidim_awesome.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true Decidim::DecidimAwesome.configure do |config| - config.weighted_proposal_voting = :disabled + config.weighted_proposal_voting = Rails.application.secrets.dig(:decidim, :decidim_awesome, :weighted_proposal_voting_enabled)&.to_sym end diff --git a/config/secrets.yml b/config/secrets.yml index c1026ced..d9c4a3a0 100644 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -13,6 +13,8 @@ default: &default asset_host: <%= ENV["ASSET_HOST"] %> decidim: + decidim_awesome: + weighted_proposal_voting_enabled: <%= ENV.fetch("DECIDIM_AWESOME_WEIGHTED_PROPOSAL_VOTING_ENABLED", "disabled") %> currency: <%= ENV["CURRENCY"] || "€" %> rack_attack: enabled: <%= ENV["ENABLE_RACK_ATTACK"] %>