diff --git a/.rubocop.yml b/.rubocop.yml index a4f10b1dd..ff1fc9fdd 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -374,6 +374,9 @@ Style/AccessorGrouping: Style/AndOr: Enabled: true +Style/ArrayCoercion: + Enabled: true + Style/BlockDelimiters: Enabled: true diff --git a/app/controllers/concerns/translatable.rb b/app/controllers/concerns/translatable.rb index 533b8db22..8bff3b08d 100644 --- a/app/controllers/concerns/translatable.rb +++ b/app/controllers/concerns/translatable.rb @@ -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 diff --git a/db/dev_seeds/users.rb b/db/dev_seeds/users.rb index 954f53282..a8b5ee429 100644 --- a/db/dev_seeds/users.rb +++ b/db/dev_seeds/users.rb @@ -17,7 +17,7 @@ section "Creating Users" do def unique_document_number @document_number ||= 12345678 @document_number += 1 - "#{@document_number}#{[*"A".."Z"].sample}" + "#{@document_number}#{("A".."Z").to_a.sample}" end admin = create_user("admin@consul.dev", "admin")