From 1bc21745296d273726c164c0f21b2b6886d79a98 Mon Sep 17 00:00:00 2001 From: Chris Beer Date: Fri, 8 Jan 2021 08:11:29 -0800 Subject: [PATCH] Double-splat named parameter values --- app/helpers/blacklight/icon_helper_behavior.rb | 2 +- app/presenters/blacklight/facet_item_presenter.rb | 2 +- spec/components/blacklight/constraint_layout_component_spec.rb | 2 +- spec/models/blacklight/solr/response/facets_spec.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/helpers/blacklight/icon_helper_behavior.rb b/app/helpers/blacklight/icon_helper_behavior.rb index 81676d1ae6..f5b0757aad 100644 --- a/app/helpers/blacklight/icon_helper_behavior.rb +++ b/app/helpers/blacklight/icon_helper_behavior.rb @@ -12,7 +12,7 @@ module Blacklight::IconHelperBehavior def blacklight_icon(icon_name, options = {}) Rails.cache.fetch([:blacklight_icons, icon_name, options]) do icon = Blacklight::Icon.new(icon_name, **options) - tag.span(icon.svg.html_safe, icon.options) + tag.span(icon.svg.html_safe, **icon.options) end end end diff --git a/app/presenters/blacklight/facet_item_presenter.rb b/app/presenters/blacklight/facet_item_presenter.rb index e7c4df5de7..2b2a26b9e8 100644 --- a/app/presenters/blacklight/facet_item_presenter.rb +++ b/app/presenters/blacklight/facet_item_presenter.rb @@ -46,7 +46,7 @@ def label facet_config.query[value][:label] elsif facet_config.date localization_options = facet_config.date == true ? {} : facet_config.date - I18n.l(Time.zone.parse(value), localization_options) + I18n.l(Time.zone.parse(value), **localization_options) else value end diff --git a/spec/components/blacklight/constraint_layout_component_spec.rb b/spec/components/blacklight/constraint_layout_component_spec.rb index 98513c0b78..62166eb283 100644 --- a/spec/components/blacklight/constraint_layout_component_spec.rb +++ b/spec/components/blacklight/constraint_layout_component_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Blacklight::ConstraintLayoutComponent, type: :component do subject(:render) do - render_inline(described_class.new(params)) + render_inline(described_class.new(**params)) end let(:rendered) do diff --git a/spec/models/blacklight/solr/response/facets_spec.rb b/spec/models/blacklight/solr/response/facets_spec.rb index 46054f00d2..22469f0fde 100644 --- a/spec/models/blacklight/solr/response/facets_spec.rb +++ b/spec/models/blacklight/solr/response/facets_spec.rb @@ -109,7 +109,7 @@ let(:facet) { { name: "foo", value: "bar", hits: 1 } } before do - response.merge_facet(facet) + response.merge_facet(**facet) end context "facet does not already exist" do