From 740746af869bc9ba317febeac0acae8c93cb9fc2 Mon Sep 17 00:00:00 2001 From: Paul Mesnilgrente Date: Wed, 19 Feb 2025 14:15:38 +0100 Subject: [PATCH 1/3] conf: upgraded ruby to 3.4.1 --- .ruby-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ruby-version b/.ruby-version index be94e6f..47b322c 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.2.2 +3.4.1 From f3e07be5f85fdd9699b6398bda3c6c8e85e8d57d Mon Sep 17 00:00:00 2001 From: Paul Mesnilgrente Date: Wed, 19 Feb 2025 14:21:15 +0100 Subject: [PATCH 2/3] conf: bumped the version --- lib/supplejack/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/supplejack/version.rb b/lib/supplejack/version.rb index 625183d..7eab535 100644 --- a/lib/supplejack/version.rb +++ b/lib/supplejack/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Supplejack - VERSION = '3.0.0' + VERSION = '3.0.4' end From 0a23655ecdb1b042783e404826753ef86bf15986 Mon Sep 17 00:00:00 2001 From: Paul Mesnilgrente Date: Wed, 19 Feb 2025 14:35:22 +0100 Subject: [PATCH 3/3] conf: ignored rubocop warning... it will be fixed in a different PR --- .rubocop.yml | 1 + lib/supplejack/url_formats/item_hash.rb | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 2705a30..f6aa727 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -3,6 +3,7 @@ require: rubocop-rspec inherit_from: .rubocop_todo.yml AllCops: + NewCops: disable Exclude: - 'tmp/**/*' - 'vendor/**/*' diff --git a/lib/supplejack/url_formats/item_hash.rb b/lib/supplejack/url_formats/item_hash.rb index e7ac244..abb664f 100644 --- a/lib/supplejack/url_formats/item_hash.rb +++ b/lib/supplejack/url_formats/item_hash.rb @@ -14,6 +14,7 @@ def initialize(params = {}, search = nil) @h_locked = filters_of_type(:hl) end + # rubocop:disable Metrics/AbcSize def to_api_hash hash = {} text_value = text(params[:text]) @@ -23,8 +24,8 @@ def to_api_hash hash[:record_type] = hash[:record_type].to_i unless hash[:record_type] == 'all' hash[:page] = (params[:page] || 1).to_i hash[:per_page] = (params[:per_page] || Supplejack.per_page).to_i - hash[:and] = and_filters if and_filters.try(:any?) - hash[:without] = without_filters if without_filters.try(:any?) + hash[:and] = and_filters if and_filters&.any? + hash[:without] = without_filters if without_filters&.any? hash[:facets] = params[:facets] if params[:facets].present? hash[:facet_pivots] = params[:facet_pivots] if params[:facet_pivots].present? hash[:facets_per_page] = params[:facets_per_page].to_i if params[:facets_per_page].present? @@ -45,6 +46,7 @@ def to_api_hash hash end + # rubocop:enable Metrics/AbcSize # Returns all the active filters for the current search # These filters are used to scope the search results