From 588ce8d9aecc4dcc84986b5f8a34acbdb213b259 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 3 Dec 2023 20:28:01 +0000 Subject: [PATCH 1/3] Bump rubocop from 1.57.2 to 1.58.0 Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.57.2 to 1.58.0. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.57.2...v1.58.0) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index f626b999d..ff4b120d2 100644 --- a/Gemfile +++ b/Gemfile @@ -93,7 +93,7 @@ group :development, :test do gem 'pry-byebug' gem 'pry-rails' - gem 'rubocop', '~> 1.57.2', require: false + gem 'rubocop', '~> 1.58.0', require: false gem 'rubocop-minitest', require: false gem 'rubocop-performance', require: false gem 'rubocop-rails', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 8202cda66..3bfc0ceeb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -293,7 +293,7 @@ GEM jbuilder (2.11.5) actionview (>= 5.0.0) activesupport (>= 5.0.0) - json (2.6.3) + json (2.7.0) json-schema (4.1.1) addressable (>= 2.8) jwt (2.2.3) @@ -479,7 +479,7 @@ GEM rsolr (2.5.0) builder (>= 2.1.2) faraday (>= 0.9, < 3, != 2.0.0) - rubocop (1.57.2) + rubocop (1.58.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -487,7 +487,7 @@ GEM rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) rubocop-ast (1.30.0) @@ -679,7 +679,7 @@ DEPENDENCIES redis (~> 4.8) rollbar rsolr - rubocop (~> 1.57.2) + rubocop (~> 1.58.0) rubocop-minitest rubocop-performance rubocop-rails From 68abbc31f0a149c4d5a2aa005451633234ad2fbe Mon Sep 17 00:00:00 2001 From: Shane Murnaghan <1930474+murny@users.noreply.github.com> Date: Sun, 3 Dec 2023 14:45:24 -0700 Subject: [PATCH 2/3] Fix violations from new cops --- app/controllers/concerns/draft_actions.rb | 6 +++--- app/controllers/concerns/draft_files_actions.rb | 2 +- app/controllers/search_controller.rb | 2 +- app/models/item.rb | 2 +- .../solr_services/deferred_faceted_solr_query.rb | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/controllers/concerns/draft_actions.rb b/app/controllers/concerns/draft_actions.rb index d55e8be26..038bc9ea3 100644 --- a/app/controllers/concerns/draft_actions.rb +++ b/app/controllers/concerns/draft_actions.rb @@ -124,11 +124,11 @@ def item_class end def describe_step_name - "describe_#{item_class.model_name.singular}".to_sym + :"describe_#{item_class.model_name.singular}" end def review_step_name - "review_and_deposit_#{item_class.model_name.singular}".to_sym + :"review_and_deposit_#{item_class.model_name.singular}" end def draft_param @@ -136,7 +136,7 @@ def draft_param end def draft_id_param - "#{item_class.model_name.singular}_id".to_sym + :"#{item_class.model_name.singular}_id" end def set_draft diff --git a/app/controllers/concerns/draft_files_actions.rb b/app/controllers/concerns/draft_files_actions.rb index 2353dc931..cfbb25bf5 100644 --- a/app/controllers/concerns/draft_files_actions.rb +++ b/app/controllers/concerns/draft_files_actions.rb @@ -58,7 +58,7 @@ def item_class end def draft_id_param - "#{item_class.model_name.singular}_id".to_sym + :"#{item_class.model_name.singular}_id" end def set_draft diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index 46d757506..b5f06f549 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -5,7 +5,7 @@ class SearchController < ApplicationController skip_after_action :verify_authorized def index - models = case (params[:tab] || DEFAULT_TAB) + models = case params[:tab] || DEFAULT_TAB when 'item' [Item, Thesis] when 'collection' diff --git a/app/models/item.rb b/app/models/item.rb index b6da36884..f3a5484b7 100644 --- a/app/models/item.rb +++ b/app/models/item.rb @@ -64,7 +64,7 @@ def item_type_with_status_code publication_status_code = ControlledVocabulary.era.publication_status.from_uri(publication_status.first) # Next line of code means that 'article_submitted' exists, but 'article_draft' doesn't ("There can be only one!") publication_status_code = :submitted if publication_status_code == :draft - "#{item_type_code}_#{publication_status_code}".to_sym + :"#{item_type_code}_#{publication_status_code}" rescue ArgumentError nil end diff --git a/app/models/jupiter_core/solr_services/deferred_faceted_solr_query.rb b/app/models/jupiter_core/solr_services/deferred_faceted_solr_query.rb index 60db7180b..2631b057e 100644 --- a/app/models/jupiter_core/solr_services/deferred_faceted_solr_query.rb +++ b/app/models/jupiter_core/solr_services/deferred_faceted_solr_query.rb @@ -168,9 +168,9 @@ def limit_value end # Kaminari integration - define_method Kaminari.config.page_method_name, (proc { |num| + define_method Kaminari.config.page_method_name, proc { |num| limit(default_per_page).offset(default_per_page * ([num.to_i, 1].max - 1)) - }) + } def count @count_cache ||= super From 89a5b8b510273dec1d01e509aa25519c0dbb0c86 Mon Sep 17 00:00:00 2001 From: Shane Murnaghan <1930474+murny@users.noreply.github.com> Date: Wed, 13 Dec 2023 21:01:58 -0700 Subject: [PATCH 3/3] Add changelog entry --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb445931d..2dd03a664 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ New entries in this file should aim to provide a meaningful amount of informatio ## [Unreleased] +### Chores +- Bump rubocop from 1.57.2 to 1.58.0 [PR#3299](https://github.com/ualbertalib/jupiter/pull/3299) + ## [2.6.1] - 2023-10-17 ### Added