From bf10cf0c1875ed20b8cb701352db2cbbb57386a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 7 May 2021 00:04:45 +0200 Subject: [PATCH] Simplify calls to content_block helper All calls were using `I18n.locale` as the second parameter, so we might as well make it optional. --- app/components/layout/social_component.rb | 2 +- app/components/layout/top_links_component.rb | 2 +- app/helpers/application_helper.rb | 2 +- app/views/shared/_subnavigation.html.erb | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/components/layout/social_component.rb b/app/components/layout/social_component.rb index 3dd944c0e..779b47cc2 100644 --- a/app/components/layout/social_component.rb +++ b/app/components/layout/social_component.rb @@ -26,6 +26,6 @@ class Layout::SocialComponent < ApplicationComponent end def footer_content_block - content_block("footer", I18n.locale) + content_block("footer") end end diff --git a/app/components/layout/top_links_component.rb b/app/components/layout/top_links_component.rb index ad45468c5..7c5c17f88 100644 --- a/app/components/layout/top_links_component.rb +++ b/app/components/layout/top_links_component.rb @@ -8,6 +8,6 @@ class Layout::TopLinksComponent < ApplicationComponent private def top_links_content_block - content_block("top_links", I18n.locale) + content_block("top_links") end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7f23d83b6..b14baa148 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -48,7 +48,7 @@ module ApplicationHelper SiteCustomization::Image.image_path_for(filename) || filename end - def content_block(name, locale) + def content_block(name, locale = I18n.locale) SiteCustomization::ContentBlock.block_for(name, locale) end diff --git a/app/views/shared/_subnavigation.html.erb b/app/views/shared/_subnavigation.html.erb index 463122a8c..b8aa0fc84 100644 --- a/app/views/shared/_subnavigation.html.erb +++ b/app/views/shared/_subnavigation.html.erb @@ -1,6 +1,6 @@