fix rubopcop offenses Performance/StringIdentifierArgument

This commit is contained in:
Alexander Meindl 2023-12-17 08:54:45 +01:00
parent e1338290c6
commit 1fe076ba0d
5 changed files with 10 additions and 12 deletions

View File

@ -51,13 +51,13 @@ module AdditionalsJournalsHelper
entity_type = entity.model_name.param_key
safe_join [link_to(l(:button_edit),
send("edit_#{entity_type}_journal_path", journal),
send(:"edit_#{entity_type}_journal_path", journal),
remote: true,
method: 'get',
title: l(:button_edit),
class: 'icon-only icon-edit'),
link_to(l(:button_delete),
send("#{entity_type}_journal_path", journal, journal: { notes: '' }),
send(:"#{entity_type}_journal_path", journal, journal: { notes: '' }),
remote: true,
method: 'put', data: { confirm: l(:text_are_you_sure) },
title: l(:button_delete),
@ -123,7 +123,7 @@ module AdditionalsJournalsHelper
# rubocop: enable Style/OptionalBooleanParameter
def render_email_attributes(entry, html: false)
items = send "email_#{entry.class.name.underscore}_attributes", entry, html
items = send :"email_#{entry.class.name.underscore}_attributes", entry, html
if html
tag.ul class: 'details' do
items.map { |s| concat tag.li(s) }.join("\n")

View File

@ -23,7 +23,7 @@ module AdditionalsQueriesHelper
def additionals_retrieve_query(object_type, user_filter: nil, search_string: nil)
session_key = additionals_query_session_key object_type
query_class = Object.const_get "#{object_type.camelcase}Query"
query_class = Object.const_get :"#{object_type.camelcase}Query"
if params[:query_id].present?
additionals_load_query_id query_class,
session_key,

View File

@ -471,7 +471,7 @@ module DashboardsHelper
nil
end
else
send "render_#{block_definition[:name]}_block",
send :"render_#{block_definition[:name]}_block",
block,
block_definition,
settings,

View File

@ -110,7 +110,7 @@ module Additionals
def additionals_library_load(module_names)
s = []
Array(module_names).each do |module_name|
s << send("additionals_load_#{module_name}")
s << send(:"additionals_load_#{module_name}")
end
safe_join s
end
@ -147,7 +147,7 @@ module Additionals
partial: 'additionals/select2_ajax_call',
formats: [:js],
locals: { field_name_id: sanitize_to_id(name),
ajax_url: send("#{type}_path", ajax_params),
ajax_url: send(:"#{type}_path", ajax_params),
options: options })
safe_join s
end

View File

@ -129,20 +129,18 @@ module Additionals
end
def change_plugin_settings(plugin, settings)
instance_variable_set "@saved_#{plugin}_settings", Setting.send("plugin_#{plugin}").dup
new_settings = Setting.send("plugin_#{plugin}").dup
instance_variable_set :"@saved_#{plugin}_settings", Setting.send(:"plugin_#{plugin}").dup
new_settings = Setting.send(:"plugin_#{plugin}").dup
settings.each do |key, value|
new_settings[key] = value
end
Setting.send "plugin_#{plugin}=", new_settings
Setting.send :"plugin_#{plugin}=", new_settings
end
def restore_plugin_settings(plugin)
settings = instance_variable_get "@saved_#{plugin}_settings"
settings = instance_variable_get :"@saved_#{plugin}_settings"
if settings
Setting.send "plugin_#{plugin}=", settings
Setting.send :"plugin_#{plugin}=", settings
else
Rails.logger.warn "warning: restore_plugin_settings could not restore settings for #{plugin}"