diff --git a/.rubocop.yml b/.rubocop.yml index b752a9656..4d0d06dfa 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1199,7 +1199,8 @@ Style/StructInheritance: Enabled: false Style/SymbolArray: - Enabled: false + Enabled: true + EnforcedStyle: brackets Style/SymbolLiteral: Enabled: true diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 2573a9a38..a97facd7a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -143,7 +143,7 @@ class ApplicationController < ActionController::Base elsif api_request render json: { error: MAINTENANCE_MESSAGE }.to_json, status: :service_unavailable else - %i(user gestionnaire administrateur).each { |role| sign_out(role) } + [:user, :gestionnaire, :administrateur].each { |role| sign_out(role) } flash[:alert] = MAINTENANCE_MESSAGE redirect_to root_path end diff --git a/app/controllers/gestionnaires/passwords_controller.rb b/app/controllers/gestionnaires/passwords_controller.rb index df49d7a13..44049eebc 100644 --- a/app/controllers/gestionnaires/passwords_controller.rb +++ b/app/controllers/gestionnaires/passwords_controller.rb @@ -1,6 +1,6 @@ class Gestionnaires::PasswordsController < Devise::PasswordsController - after_action :try_to_authenticate_user, only: %i(update) - after_action :try_to_authenticate_administrateur, only: %i(update) + after_action :try_to_authenticate_user, only: [:update] + after_action :try_to_authenticate_administrateur, only: [:update] # GET /resource/password/new # def new diff --git a/app/controllers/users/passwords_controller.rb b/app/controllers/users/passwords_controller.rb index 92ffda801..f65b71202 100644 --- a/app/controllers/users/passwords_controller.rb +++ b/app/controllers/users/passwords_controller.rb @@ -1,6 +1,6 @@ class Users::PasswordsController < Devise::PasswordsController - after_action :try_to_authenticate_gestionnaire, only: %i(update) - after_action :try_to_authenticate_administrateur, only: %i(update) + after_action :try_to_authenticate_gestionnaire, only: [:update] + after_action :try_to_authenticate_administrateur, only: [:update] # GET /resource/password/new # def new diff --git a/app/models/attestation_template.rb b/app/models/attestation_template.rb index d44d4196f..0cf20c5c4 100644 --- a/app/models/attestation_template.rb +++ b/app/models/attestation_template.rb @@ -61,7 +61,7 @@ class AttestationTemplate < ApplicationRecord end def logo_signature_file_size - %i[logo signature] + [:logo, :signature] .select { |file_name| send(file_name).present? } .each { |file_name| file_size_check(file_name) } end diff --git a/app/models/procedure.rb b/app/models/procedure.rb index 8f9c31861..6ffe9a620 100644 --- a/app/models/procedure.rb +++ b/app/models/procedure.rb @@ -224,7 +224,7 @@ class Procedure < ApplicationRecord procedure.logo_secure_token = nil procedure.remote_logo_url = self.logo_url - %i(notice deliberation).each { |attachment| clone_attachment(procedure, attachment) } + [:notice, :deliberation].each { |attachment| clone_attachment(procedure, attachment) } procedure.administrateur = admin procedure.initiated_mail = initiated_mail&.dup diff --git a/lib/tasks/2017_12_04_translate_dossier_state_to_french.rake b/lib/tasks/2017_12_04_translate_dossier_state_to_french.rake index be3a6fd6c..8c54200f2 100644 --- a/lib/tasks/2017_12_04_translate_dossier_state_to_french.rake +++ b/lib/tasks/2017_12_04_translate_dossier_state_to_french.rake @@ -23,7 +23,7 @@ namespace :'2017_12_04_translate_dossier_state_to_french' do Dossier.unscoped.where(state: 'without_continuation').update_all(state: 'sans_suite') end - task all: %i(brouillon en_construction en_instruction accepte refuse sans_suite) do + task all: [:brouillon, :en_construction, :en_instruction, :accepte, :refuse, :sans_suite] do end task revert: :environment do