Browse Source

Maintenance: Update dependency rubocop-performance to v1.19.0

renovatebot 1 year ago
parent
commit
150a38eb78

+ 1 - 1
Gemfile.lock

@@ -514,7 +514,7 @@ GEM
       activesupport
       rubocop
       rubocop-rspec
-    rubocop-performance (1.18.0)
+    rubocop-performance (1.19.0)
       rubocop (>= 1.7.0, < 2.0)
       rubocop-ast (>= 0.4.0)
     rubocop-rails (2.20.2)

+ 1 - 1
app/controllers/knowledge_base/public/answers_controller.rb

@@ -19,7 +19,7 @@ class KnowledgeBase::Public::AnswersController < KnowledgeBase::Public::BaseCont
 
     raise ActiveRecord::RecordNotFound if !@alternative&.translations&.any?
 
-    @object_locales = @alternative.translations.map(&:kb_locale).map(&:system_locale)
+    @object_locales = @alternative.translations.map { |x| x.kb_locale.system_locale }
 
     render 'knowledge_base/public/show_alternatives', locals: { name: 'Answer' }
   end

+ 1 - 1
app/controllers/knowledge_base/public/categories_controller.rb

@@ -53,7 +53,7 @@ class KnowledgeBase::Public::CategoriesController < KnowledgeBase::Public::BaseC
       raise ActiveRecord::RecordNotFound
     end
 
-    @object_locales = @alternative.translations.map(&:kb_locale).map(&:system_locale)
+    @object_locales = @alternative.translations.map { |x| x.kb_locale.system_locale }
 
     render 'knowledge_base/public/show_alternatives', locals: { name: 'Category' }
   end

+ 1 - 1
app/controllers/search_controller.rb

@@ -17,7 +17,7 @@ class SearchController < ApplicationController
     # convert objects string into array of class names
     # e.g. user-ticket-another_object = %w( User Ticket AnotherObject )
     objects = if params[:objects]
-                params[:objects].split('-').map(&:camelize).map(&:constantize)
+                params[:objects].split('-').map { |x| x.camelize.constantize }
               else
                 Models.searchable
               end

+ 1 - 1
app/controllers/tickets_shared_draft_starts_controller.rb

@@ -77,7 +77,7 @@ class TicketsSharedDraftStartsController < ApplicationController
 
     safe_params[:content].delete :group_id
 
-    allowed_groups = current_user.groups_access('create').map(&:id).map(&:to_s)
+    allowed_groups = current_user.groups_access('create').map { |x| x.id.to_s }
     group_id       = safe_params[:group_id]&.to_s
 
     if allowed_groups.exclude? group_id

+ 1 - 1
app/models/application_model/can_associations.rb

@@ -154,7 +154,7 @@ returns
                 .pluck(*pluck)
 
       if keys.size > 1
-        values = ids.transpose.map(&:compact).map(&:uniq)
+        values = ids.transpose.map { |x| x.compact.uniq }
         attributes.merge!(keys.zip(values).to_h)
       else
         attributes[ keys.first ] = ids.compact

+ 1 - 1
app/models/core_workflow/condition.rb

@@ -76,7 +76,7 @@ class CoreWorkflow::Condition
   end
 
   def condition_value_result(obj)
-    Array.wrap(obj).map(&:to_s).map(&:html2text)
+    Array.wrap(obj).map { |x| x.to_s.html2text }
   end
 
   def condition_value_match?(key, condition, value)

+ 1 - 1
app/models/webhook/pre_defined.rb

@@ -8,7 +8,7 @@ class Webhook::PreDefined
   end
 
   def self.pre_defined_webhook_definitions
-    pre_defined_webhooks.map(&:new).map(&:definition)
+    pre_defined_webhooks.map { |x| x.new.definition }
   end
 
   def definition

+ 1 - 1
db/migrate/20190724000001_rename_reserved_words.rb

@@ -4,7 +4,7 @@ class RenameReservedWords < ActiveRecord::Migration[5.1]
   def up
     return if !Setting.exists?(name: 'system_init_done')
 
-    models = ObjectManager.list_objects.map(&:underscore).map { |object| object.tr('_', '/') }.map(&:classify).map(&:constantize)
+    models = ObjectManager.list_objects.map(&:underscore).map { |object| object.tr('_', '/') }.map { |x| x.classify.constantize }
 
     reserved_words = %w[url icon initials avatar permission validate subscribe unsubscribe translate search]
     models.each do |model|

+ 1 - 1
spec/graphql/gql/mutations/online_notification/seen_spec.rb

@@ -45,7 +45,7 @@ RSpec.describe Gql::Mutations::OnlineNotification::Seen, :aggregate_failures, ty
         end
 
         it 'does not mark other notifications for the same object as seen' do
-          expect(other_notifications.map(&:reload).map(&:seen)).to all(be(false))
+          expect(other_notifications.map { |x| x.reload.seen }).to all(be(false))
         end
       end
 

Some files were not shown because too many files changed in this diff