Use explicit syntax for section objects in preference_sections definition

This commit is contained in:
Hugo Daniel
2018-09-13 12:34:06 +02:00
parent cc43d789e2
commit 8dd0e01b8e
2 changed files with 11 additions and 5 deletions

View File

@@ -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

View File

@@ -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