From fac03ff7ff95b04d65d4bd43842eae420e414ccc Mon Sep 17 00:00:00 2001 From: Martin Gruner Date: Mon, 27 Dec 2021 15:50:27 +0100 Subject: [PATCH] Maintenance: Bump rubocop-performance from 1.12.0 to 1.13.0 Bumps [rubocop-performance](https://github.com/rubocop/rubocop-performance) from 1.12.0 to 1.13.0. - [Release notes](https://github.com/rubocop/rubocop-performance/releases) - [Changelog](https://github.com/rubocop/rubocop-performance/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-performance/compare/v1.12.0...v1.13.0) --- Gemfile.lock | 8 ++++---- app/models/application_model/can_cleanup_param.rb | 2 +- app/models/application_model/has_cache.rb | 4 ++-- app/models/concerns/has_history.rb | 8 ++++---- app/models/transaction/notification.rb | 8 ++++---- app/models/transaction/slack.rb | 8 ++++---- config/spring_client.rb | 8 ++++---- lib/stats/ticket_load_measure.rb | 2 +- lib/stats/ticket_reopen.rb | 2 +- lib/transaction_dispatcher.rb | 2 +- 10 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 35c95d363..4170a738b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -401,7 +401,7 @@ GEM iniparse (~> 1.4) rexml (~> 3.2) parallel (1.21.0) - parser (3.0.2.0) + parser (3.0.3.2) ast (~> 2.4.1) pg (0.21.0) power_assert (2.0.1) @@ -477,7 +477,7 @@ GEM ffi (~> 1.0) rchardet (1.8.0) redis (4.5.1) - regexp_parser (2.1.1) + regexp_parser (2.2.0) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) http-cookie (>= 1.0.2, < 2.0) @@ -511,7 +511,7 @@ GEM rubocop-ast (>= 1.12.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.13.0) + rubocop-ast (1.15.0) parser (>= 3.0.1.1) rubocop-faker (1.1.0) faker (>= 2.12.0) @@ -520,7 +520,7 @@ GEM activesupport rubocop rubocop-rspec - rubocop-performance (1.12.0) + rubocop-performance (1.13.0) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) rubocop-rails (2.12.4) diff --git a/app/models/application_model/can_cleanup_param.rb b/app/models/application_model/can_cleanup_param.rb index 751399fc8..7b48149ac 100644 --- a/app/models/application_model/can_cleanup_param.rb +++ b/app/models/application_model/can_cleanup_param.rb @@ -71,7 +71,7 @@ returns clean_params[attribute] = data[attribute] end - clean_params['form_id'] = data['form_id'] if data.key?('form_id') && new.respond_to?('form_id') + clean_params['form_id'] = data['form_id'] if data.key?('form_id') && new.respond_to?(:form_id) if inside_nested clean_params['id'] = params[:id] if params[:id].present? diff --git a/app/models/application_model/has_cache.rb b/app/models/application_model/has_cache.rb index 02a54d042..be872db43 100644 --- a/app/models/application_model/has_cache.rb +++ b/app/models/application_model/has_cache.rb @@ -9,8 +9,8 @@ module ApplicationModel::HasCache end def cache_update(other) - cache_delete if respond_to?('cache_delete') - other.cache_delete if other.respond_to?('cache_delete') + cache_delete if respond_to?(:cache_delete) + other.cache_delete if other.respond_to?(:cache_delete) ActiveSupport::CurrentAttributes.clear_all true end diff --git a/app/models/concerns/has_history.rb b/app/models/concerns/has_history.rb index 512e2c0c7..c09eaa662 100644 --- a/app/models/concerns/has_history.rb +++ b/app/models/concerns/has_history.rb @@ -77,8 +77,8 @@ log object update history with all updated attributes, if configured - will be e if relation_model if relation_model['name'] value_str[0] = relation_model['name'] - elsif relation_model.respond_to?('fullname') - value_str[0] = relation_model.send('fullname') + elsif relation_model.respond_to?(:fullname) + value_str[0] = relation_model.send(:fullname) end end end @@ -87,8 +87,8 @@ log object update history with all updated attributes, if configured - will be e if relation_model if relation_model['name'] value_str[1] = relation_model['name'] - elsif relation_model.respond_to?('fullname') - value_str[1] = relation_model.send('fullname') + elsif relation_model.respond_to?(:fullname) + value_str[1] = relation_model.send(:fullname) end end end diff --git a/app/models/transaction/notification.rb b/app/models/transaction/notification.rb index 03964e8ac..ecdad3773 100644 --- a/app/models/transaction/notification.rb +++ b/app/models/transaction/notification.rb @@ -299,8 +299,8 @@ class Transaction::Notification if relation_model if relation_model['name'] value_str[0] = relation_model['name'] - elsif relation_model.respond_to?('fullname') - value_str[0] = relation_model.send('fullname') + elsif relation_model.respond_to?(:fullname) + value_str[0] = relation_model.send(:fullname) end end end @@ -309,8 +309,8 @@ class Transaction::Notification if relation_model if relation_model['name'] value_str[1] = relation_model['name'] - elsif relation_model.respond_to?('fullname') - value_str[1] = relation_model.send('fullname') + elsif relation_model.respond_to?(:fullname) + value_str[1] = relation_model.send(:fullname) end end end diff --git a/app/models/transaction/slack.rb b/app/models/transaction/slack.rb index 2f4f7b9f2..2bb4cab02 100644 --- a/app/models/transaction/slack.rb +++ b/app/models/transaction/slack.rb @@ -250,8 +250,8 @@ class Transaction::Slack if relation_model if relation_model['name'] value_str[0] = relation_model['name'] - elsif relation_model.respond_to?('fullname') - value_str[0] = relation_model.send('fullname') + elsif relation_model.respond_to?(:fullname) + value_str[0] = relation_model.send(:fullname) end end end @@ -260,8 +260,8 @@ class Transaction::Slack if relation_model if relation_model['name'] value_str[1] = relation_model['name'] - elsif relation_model.respond_to?('fullname') - value_str[1] = relation_model.send('fullname') + elsif relation_model.respond_to?(:fullname) + value_str[1] = relation_model.send(:fullname) end end end diff --git a/config/spring_client.rb b/config/spring_client.rb index 4916e3819..1523ab58c 100644 --- a/config/spring_client.rb +++ b/config/spring_client.rb @@ -7,11 +7,11 @@ module Spring DEFAULT_COMMANDS = COMMANDS.dup DEFAULT_ALIASES = ALIASES.dup - remove_const('COMMANDS') - remove_const('ALIASES') + remove_const(:COMMANDS) + remove_const(:ALIASES) - const_set('COMMANDS', DEFAULT_COMMANDS + %w[server]) - const_set('ALIASES', DEFAULT_ALIASES.merge('s' => 'server')) + const_set(:COMMANDS, DEFAULT_COMMANDS + %w[server]) + const_set(:ALIASES, DEFAULT_ALIASES.merge('s' => 'server')) end end end diff --git a/lib/stats/ticket_load_measure.rb b/lib/stats/ticket_load_measure.rb index 68ec1a4e6..7ca0b765a 100644 --- a/lib/stats/ticket_load_measure.rb +++ b/lib/stats/ticket_load_measure.rb @@ -37,7 +37,7 @@ class Stats::TicketLoadMeasure return result if !result.key?(:used_for_average) - if result[:total] < 1 || result[:average_per_agent].to_d == 0.0.to_d + if result[:total] < 1 || result[:average_per_agent].to_d == BigDecimal('0.0') result[:state] = 'supergood' return result end diff --git a/lib/stats/ticket_reopen.rb b/lib/stats/ticket_reopen.rb index 31daf431c..8c1cf56d6 100644 --- a/lib/stats/ticket_reopen.rb +++ b/lib/stats/ticket_reopen.rb @@ -38,7 +38,7 @@ class Stats::TicketReopen return result if !result.key?(:used_for_average) - if result[:total] < 1 || result[:average_per_agent].to_d == 0.0.to_d + if result[:total] < 1 || result[:average_per_agent].to_d == BigDecimal('0.0') result[:state] = 'supergood' return result end diff --git a/lib/transaction_dispatcher.rb b/lib/transaction_dispatcher.rb index ef34c5497..cd3aaf0fc 100644 --- a/lib/transaction_dispatcher.rb +++ b/lib/transaction_dispatcher.rb @@ -213,7 +213,7 @@ class TransactionDispatcher # do not send anything if nothing has changed return true if real_changes.blank? - changed_by_id = if record.respond_to?('updated_by_id') + changed_by_id = if record.respond_to?(:updated_by_id) record.updated_by_id else record.created_by_id