Add and apply ArrayCoercion rubocop rule
This rule was added in Rubocop 0.88.0.
This commit is contained in:
@@ -6,10 +6,10 @@ module Translatable
|
||||
def translation_params(resource_model, options = {})
|
||||
attributes = [:id, :locale, :_destroy]
|
||||
if options[:only]
|
||||
attributes += [*options[:only]]
|
||||
attributes += Array(options[:only])
|
||||
else
|
||||
attributes += resource_model.translated_attribute_names
|
||||
end
|
||||
{ translations_attributes: attributes - [*options[:except]] }
|
||||
{ translations_attributes: attributes - Array(options[:except]) }
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user