Enable the Layout/MultilineMethodCallBraceLayout cop
This commit is contained in:
parent
5077e654f2
commit
b77837bfd1
8 changed files with 32 additions and 28 deletions
|
@ -138,7 +138,8 @@ Layout/MultilineHashBraceLayout:
|
|||
EnforcedStyle: new_line
|
||||
|
||||
Layout/MultilineMethodCallBraceLayout:
|
||||
Enabled: false
|
||||
Enabled: true
|
||||
EnforcedStyle: symmetrical
|
||||
|
||||
Layout/MultilineMethodCallIndentation:
|
||||
Enabled: false
|
||||
|
|
|
@ -100,7 +100,8 @@ class Admin::ProceduresController < AdminController
|
|||
path: params[:procedure_path],
|
||||
procedure: procedure,
|
||||
administrateur: procedure.administrateur
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
if new_procedure_path.validate
|
||||
new_procedure_path.delete
|
||||
|
|
|
@ -16,9 +16,10 @@ class UsersController < ApplicationController
|
|||
end
|
||||
|
||||
def authorized_routes? controller
|
||||
redirect_to_root_path 'Le statut de votre dossier n\'autorise pas cette URL' if !UserRoutesAuthorizationService.authorized_route?(
|
||||
controller,
|
||||
current_user_dossier)
|
||||
if !UserRoutesAuthorizationService.authorized_route?(controller, current_user_dossier)
|
||||
redirect_to_root_path 'Le statut de votre dossier n\'autorise pas cette URL'
|
||||
end
|
||||
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
redirect_to_root_path 'Vous n’avez pas accès à ce dossier.'
|
||||
end
|
||||
|
|
|
@ -5,7 +5,8 @@ class FranceConnectService
|
|||
client.authorization_uri(
|
||||
scope: [:profile, :email],
|
||||
state: SecureRandom.hex(16),
|
||||
nonce: SecureRandom.hex(16))
|
||||
nonce: SecureRandom.hex(16)
|
||||
)
|
||||
end
|
||||
|
||||
def self.retrieve_user_informations_particulier(code)
|
||||
|
@ -22,6 +23,7 @@ class FranceConnectService
|
|||
email_france_connect: user_info[:email],
|
||||
birthdate: user_info[:birthdate],
|
||||
birthplace: user_info[:birthplace],
|
||||
france_connect_particulier_id: user_info[:sub])
|
||||
france_connect_particulier_id: user_info[:sub]
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -26,14 +26,16 @@ class ModuleApiCartoService
|
|||
def self.generate_qp coordinates
|
||||
coordinates.inject({}) { |acc, coordinate|
|
||||
acc.merge CARTO::SGMAP::QuartiersPrioritaires::Adapter.new(
|
||||
coordinate.map { |element| [element['lng'], element['lat']] }).to_params
|
||||
coordinate.map { |element| [element['lng'], element['lat']] }
|
||||
).to_params
|
||||
}
|
||||
end
|
||||
|
||||
def self.generate_cadastre coordinates
|
||||
(coordinates.inject([]) { |acc, coordinate|
|
||||
acc << CARTO::SGMAP::Cadastre::Adapter.new(
|
||||
coordinate.map { |element| [element['lng'], element['lat']] }).to_params
|
||||
coordinate.map { |element| [element['lng'], element['lat']] }
|
||||
).to_params
|
||||
}).flatten
|
||||
end
|
||||
end
|
||||
|
|
|
@ -9,28 +9,22 @@ class SyncCredentialsService
|
|||
def change_credentials!
|
||||
if @klass != User
|
||||
user = User.find_by(email: @email_was)
|
||||
if user
|
||||
return false if !user.update_columns(
|
||||
email: @email,
|
||||
encrypted_password: @encrypted_password)
|
||||
if user && !user.update_columns(email: @email, encrypted_password: @encrypted_password)
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
if @klass != Gestionnaire
|
||||
gestionnaire = Gestionnaire.find_by(email: @email_was)
|
||||
if gestionnaire
|
||||
return false if !gestionnaire.update_columns(
|
||||
email: @email,
|
||||
encrypted_password: @encrypted_password)
|
||||
if gestionnaire && !gestionnaire.update_columns(email: @email, encrypted_password: @encrypted_password)
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
if @klass != Administrateur
|
||||
administrateur = Administrateur.find_by(email: @email_was)
|
||||
if administrateur
|
||||
return false if !administrateur.update_columns(
|
||||
email: @email,
|
||||
encrypted_password: @encrypted_password)
|
||||
if administrateur && !administrateur.update_columns(email: @email, encrypted_password: @encrypted_password)
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -23,7 +23,8 @@ namespace :'2017_10_06_set_follow_date' do
|
|||
demande_seen_at: gestionnaire.current_sign_in_at,
|
||||
annotations_privees_seen_at: gestionnaire.current_sign_in_at,
|
||||
avis_seen_at: gestionnaire.current_sign_in_at,
|
||||
messagerie_seen_at: gestionnaire.current_sign_in_at)
|
||||
messagerie_seen_at: gestionnaire.current_sign_in_at
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -2,24 +2,26 @@ require 'spec_helper'
|
|||
|
||||
describe 'users/description/_pieces_justificatives.html.haml', type: :view do
|
||||
let!(:procedure) { create(:procedure) }
|
||||
let!(:tpj1) {
|
||||
create(:type_de_piece_justificative,
|
||||
let!(:tpj1) do
|
||||
create(
|
||||
:type_de_piece_justificative,
|
||||
procedure: procedure,
|
||||
libelle: "Première pièce jointe",
|
||||
description: "Première description",
|
||||
order_place: 1,
|
||||
mandatory: true
|
||||
)
|
||||
}
|
||||
let!(:tpj2) {
|
||||
create(:type_de_piece_justificative,
|
||||
end
|
||||
let!(:tpj2) do
|
||||
create(
|
||||
:type_de_piece_justificative,
|
||||
procedure: procedure,
|
||||
libelle: "Seconde pièce jointe",
|
||||
description: "Seconde description",
|
||||
order_place: 2,
|
||||
lien_demarche: "https://www.google.fr"
|
||||
)
|
||||
}
|
||||
end
|
||||
let!(:dossier) { create(:dossier, :procedure => procedure) }
|
||||
|
||||
before do
|
||||
|
|
Loading…
Add table
Reference in a new issue