From 8dd0e01b8ee3975858f732d47863929782eaebcb Mon Sep 17 00:00:00 2001 From: Hugo Daniel Date: Thu, 13 Sep 2018 12:34:06 +0200 Subject: [PATCH] Use explicit syntax for section objects in preference_sections definition --- app/controllers/admin/contents_controller.rb | 14 ++++++++++---- app/models/content_configuration.rb | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/controllers/admin/contents_controller.rb b/app/controllers/admin/contents_controller.rb index 28f117c52c..5ac1be4f1d 100644 --- a/app/controllers/admin/contents_controller.rb +++ b/app/controllers/admin/contents_controller.rb @@ -24,10 +24,16 @@ module Admin private def preference_sections - Dir["app/models/preference_sections/*.rb"].map do |filename| - basename = 'PreferenceSections::' + File.basename(filename, '.rb').camelize - basename.constantize.new - end + [ + PreferenceSections::HeaderSection.new, + PreferenceSections::HomePageSection.new, + PreferenceSections::ProducerSignupPageSection.new, + PreferenceSections::HubSignupPageSection.new, + PreferenceSections::GroupSignupPageSection.new, + PreferenceSections::MainLinksSection.new, + PreferenceSections::FooterAndExternalLinksSection.new, + PreferenceSections::UserGuideSection.new + ] end end end diff --git a/app/models/content_configuration.rb b/app/models/content_configuration.rb index 1780389870..3e1e2b0939 100644 --- a/app/models/content_configuration.rb +++ b/app/models/content_configuration.rb @@ -71,5 +71,5 @@ EOS preference :footer_about_url, :string, default: "http://www.openfoodnetwork.org/ofn-local/open-food-network-australia/" #User Guide - preference :user_guide_link, :string, default: 'http://www.openfoodnetwork.org/platform/user-guide/' + preference :user_guide_link, :string, default: 'https://guide.openfoodnetwork.org/' end