@@ -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)
@@ -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
@@ -53,7 +53,7 @@ class KnowledgeBase::Public::CategoriesController < KnowledgeBase::Public::BaseC
raise ActiveRecord::RecordNotFound
render 'knowledge_base/public/show_alternatives', locals: { name: 'Category' }
@@ -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
@@ -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
@@ -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)
attributes[ keys.first ] = ids.compact
@@ -76,7 +76,7 @@ class CoreWorkflow::Condition
def condition_value_result(obj)
- Array.wrap(obj).map(&:to_s).map(&:html2text)
+ Array.wrap(obj).map { |x| x.to_s.html2text }
def condition_value_match?(key, condition, value)
@@ -8,7 +8,7 @@ class Webhook::PreDefined
def self.pre_defined_webhook_definitions
- pre_defined_webhooks.map(&:new).map(&:definition)
+ pre_defined_webhooks.map { |x| x.new.definition }
def definition
@@ -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|
@@ -45,7 +45,7 @@ RSpec.describe Gql::Mutations::OnlineNotification::Seen, :aggregate_failures, ty
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))