From 35c156ba7ae269cc97f894658c07c0e143b95fa3 Mon Sep 17 00:00:00 2001 From: Bertocq Date: Fri, 6 Apr 2018 11:41:04 +0200 Subject: [PATCH] Create setting to enable/disable attached documents Add setting to both seed and dev_seeds as well as a rake task to make it easier to set. --- config/locales/en/settings.yml | 1 + config/locales/es/settings.yml | 1 + db/dev_seeds/settings.rb | 1 + db/seeds.rb | 1 + lib/tasks/settings.rake | 5 +++++ 5 files changed, 9 insertions(+) diff --git a/config/locales/en/settings.yml b/config/locales/en/settings.yml index 531393e65..359e08ca9 100644 --- a/config/locales/en/settings.yml +++ b/config/locales/en/settings.yml @@ -45,6 +45,7 @@ en: community: Community on proposals and investments map: Proposals and budget investments geolocation allow_images: Allow upload and show images + allow_attached_documents: Allow upload and show of attached documents map_latitude: Latitude map_longitude: Longitude map_zoom: Zoom diff --git a/config/locales/es/settings.yml b/config/locales/es/settings.yml index d374726c5..5b137b23a 100644 --- a/config/locales/es/settings.yml +++ b/config/locales/es/settings.yml @@ -45,6 +45,7 @@ es: community: Comunidad en propuestas y proyectos de gasto map: Geolocalización de propuestas y proyectos de gasto allow_images: Permitir subir y mostrar imágenes + allow_attached_documents: Permitir creación de documentos adjuntos map_latitude: Latitud map_longitude: Longitud map_zoom: Zoom diff --git a/db/dev_seeds/settings.rb b/db/dev_seeds/settings.rb index 4551f9bee..61e5ec73c 100644 --- a/db/dev_seeds/settings.rb +++ b/db/dev_seeds/settings.rb @@ -43,6 +43,7 @@ section "Creating Settings" do Setting.create(key: 'feature.community', value: "true") Setting.create(key: 'feature.map', value: "true") Setting.create(key: 'feature.allow_images', value: "true") + Setting.create(key: 'feature.allow_attached_documents', value: "true") Setting.create(key: 'feature.public_stats', value: "true") Setting.create(key: 'feature.guides', value: nil) diff --git a/db/seeds.rb b/db/seeds.rb index 844a24d81..6367734ab 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -85,6 +85,7 @@ Setting['feature.user.recommendations'] = true Setting['feature.community'] = true Setting['feature.map'] = nil Setting['feature.allow_images'] = true +Setting['feature.allow_attached_documents'] = true Setting['feature.guides'] = nil # Spending proposals feature flags diff --git a/lib/tasks/settings.rake b/lib/tasks/settings.rake index 29dc256bb..d09d32527 100644 --- a/lib/tasks/settings.rake +++ b/lib/tasks/settings.rake @@ -8,4 +8,9 @@ namespace :settings do per_page_code_setting.destroy if per_page_code_setting.present? end + desc "Create new Attached Documents feature setting" + task create_attached_documents_setting: :environment do + Setting['feature.allow_attached_documents'] = true + end + end