Fix new rubocop offenses

This commit is contained in:
Alexander Meindl 2020-11-24 15:52:16 +01:00
parent 589a18d821
commit a95e32e7f1
4 changed files with 5 additions and 4 deletions

View File

@ -83,7 +83,7 @@ module AdditionalsQueriesHelper
scope = scope.visible unless options[:all_visible]
scope = scope.where.not(id: exclude_id) if exclude_id.positive?
scope = scope.where(options[:where_filter], options[:where_params]) if options[:where_filter]
q.split(' ').map { |search_string| scope = scope.like(search_string) } if q.present?
q.split.map { |search_string| scope = scope.like(search_string) } if q.present?
scope = scope.order(last_login_on: :desc)
.limit(Additionals::SELECT2_INIT_ENTRIES)
@users = scope.to_a.sort! { |x, y| x.name <=> y.name }

View File

@ -4,6 +4,7 @@ class Dashboard < ActiveRecord::Base
include Additionals::EntityMethods
class SystemDefaultChangeException < StandardError; end
class ProjectSystemDefaultChangeException < StandardError; end
belongs_to :project

View File

@ -212,12 +212,12 @@ module Additionals
def project_list_css_classes(project, level)
classes = [cycle('odd', 'even')]
classes += project.css_classes.split(' ')
classes += project.css_classes.split
if level.positive?
classes << 'idnt'
classes << "idnt-#{level}"
end
classes.join(' ')
classes.join ' '
end
def addtionals_textarea_cols(text, options = {})

View File

@ -48,7 +48,7 @@ module Additionals
classes << "fa-#{values[0]}"
end
classes += options[:class].split(' ') if options[:class].present?
classes += options[:class].split if options[:class].present?
classes << "fa-#{options[:size]}" if options[:size].present?
content_options = { class: classes.uniq.join(' ') }