make rubocop happy

This commit is contained in:
Alexander Meindl 2020-10-09 09:09:56 +02:00
parent ea013df17b
commit 4baf5459e6
2 changed files with 5 additions and 5 deletions

View File

@ -140,13 +140,13 @@ module AdditionalsQueriesHelper
def xlsx_write_header_row(workbook, worksheet, columns)
columns_width = []
columns.each_with_index do |c, index|
value = if c.class.name == 'String'
value = if c.instance_of?('String')
c
else
c.caption.to_s
end
worksheet.write(0, index, value, workbook.add_format(xlsx_cell_format(:header)))
worksheet.write 0, index, value, workbook.add_format(xlsx_cell_format(:header))
columns_width << xlsx_get_column_width(value)
end
columns_width

View File

@ -67,10 +67,10 @@ module Additionals
end
def settings_compatible(plugin_name)
if Setting[plugin_name].class == Hash
if Setting[plugin_name].instance_of? Hash
# convert Rails 4 data (this runs only once)
new_settings = ActiveSupport::HashWithIndifferentAccess.new(Setting[plugin_name])
Setting.send("#{plugin_name}=", new_settings)
new_settings = ActiveSupport::HashWithIndifferentAccess.new Setting[plugin_name]
Setting.send "#{plugin_name}=", new_settings
new_settings
else
# Rails 5 uses ActiveSupport::HashWithIndifferentAccess