From 8808409df06aec9f44f079575a4cbea1f6832d58 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 29 Sep 2023 20:03:33 +0000 Subject: [PATCH 1/3] Update rubocop-rails requirement from ~> 2.20.2 to ~> 2.21.1 Updates the requirements on [rubocop-rails](https://github.com/rubocop/rubocop-rails) to permit the latest version. - [Release notes](https://github.com/rubocop/rubocop-rails/releases) - [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.20.2...v2.21.1) --- updated-dependencies: - dependency-name: rubocop-rails dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- publify_core.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/publify_core.gemspec b/publify_core.gemspec index ff4bbedf..10d53772 100644 --- a/publify_core.gemspec +++ b/publify_core.gemspec @@ -60,7 +60,7 @@ Gem::Specification.new do |s| s.add_development_dependency "rubocop-capybara", "~> 2.19.0" s.add_development_dependency "rubocop-factory_bot", "~> 2.24.0" s.add_development_dependency "rubocop-performance", "~> 1.19.0" - s.add_development_dependency "rubocop-rails", "~> 2.20.2" + s.add_development_dependency "rubocop-rails", "~> 2.21.1" s.add_development_dependency "rubocop-rspec", "~> 2.24.1" s.add_development_dependency "shoulda-matchers", "~> 5.3" s.add_development_dependency "simplecov", "~> 0.22.0" From a98c1adea0c76c8bcba813f3fb278278632e3074 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Fri, 29 Sep 2023 22:08:23 +0200 Subject: [PATCH 2/3] Autocorrect Rails/FindEach offense --- app/controllers/admin/post_types_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/admin/post_types_controller.rb b/app/controllers/admin/post_types_controller.rb index 35572482..ea68595a 100644 --- a/app/controllers/admin/post_types_controller.rb +++ b/app/controllers/admin/post_types_controller.rb @@ -38,7 +38,7 @@ def destroy # Reset all Articles from the PostType we're destroying to the default PostType # Wrap it in a transaction for safety @post_type.transaction do - Article.where(post_type: @post_type.permalink).each do |article| + Article.where(post_type: @post_type.permalink).find_each do |article| article.post_type = "read" article.save end From 13c7251e8143412e62b040e9e14cf4a55630a4fc Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Fri, 29 Sep 2023 22:11:55 +0200 Subject: [PATCH 3/3] Autocorrect Rails/SelectMap offense --- app/controllers/admin/articles_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/admin/articles_controller.rb b/app/controllers/admin/articles_controller.rb index 4dfb138c..774fe8a2 100644 --- a/app/controllers/admin/articles_controller.rb +++ b/app/controllers/admin/articles_controller.rb @@ -93,7 +93,7 @@ def destroy end def auto_complete_for_article_keywords - @items = Tag.select(:display_name).order(:display_name).map(&:display_name) + @items = Tag.order(:display_name).pluck(:display_name) render json: @items end