Fix rubocop performances offenses

This commit is contained in:
Alexander Meindl 2023-05-21 10:42:24 +02:00
parent cdaa31c03a
commit cb3887cc28
3 changed files with 3 additions and 3 deletions

View File

@ -44,7 +44,7 @@ end
# (this is used to not create conflicts with other plugins)
if File.file? File.expand_path './.enable_test', __dir__
group :development, :test do
gem 'active_record_doctor', require: false
gem 'active_record_doctor'
gem 'bullet'
gem 'rails_best_practices', require: false
end

View File

@ -113,7 +113,7 @@ module AdditionalsQueriesHelper
.order("select_order ASC, #{User.table_name}.last_login_on DESC")
.limit(AdditionalsConf.select2_init_entries)
.to_a
.sort! { |x, y| x.name <=> y.name }
.sort_by(&:name)
with_users = false
sorted_users.each do |user|

View File

@ -15,7 +15,7 @@ module Additionals
module InstanceMethods
def fontawesome
icons = AdditionalsFontAwesome.search_for_select @search_term, params[:selected].to_s.strip
icons.sort! { |x, y| x[:text] <=> y[:text] }
icons.sort_by! { |a| a[:text] }
respond_to do |format|
format.js { render json: icons }