make rubocop happy
This commit is contained in:
parent
ea013df17b
commit
4baf5459e6
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user