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