Fix rubocop performances offenses
This commit is contained in:
parent
cdaa31c03a
commit
cb3887cc28
2
Gemfile
2
Gemfile
@ -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
|
||||
|
@ -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|
|
||||
|
@ -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 }
|
||||
|
Loading…
Reference in New Issue
Block a user