removed ask_birthday for new procedures & dossiers

This commit is contained in:
clemkeirua 2019-08-27 15:05:56 +02:00
parent 165712419e
commit 188e0fd6b2
4 changed files with 14 additions and 7 deletions

View file

@ -284,7 +284,7 @@ class Admin::ProceduresController < AdminController
permited_params = if @procedure&.locked?
params.require(:procedure).permit(*editable_params)
else
params.require(:procedure).permit(*editable_params, :duree_conservation_dossiers_dans_ds, :duree_conservation_dossiers_hors_ds, :for_individual, :ask_birthday, :path)
params.require(:procedure).permit(*editable_params, :duree_conservation_dossiers_dans_ds, :duree_conservation_dossiers_hors_ds, :for_individual, :path)
end
permited_params[:logo_active_storage] = permited_params.delete(:logo)
permited_params

View file

@ -236,6 +236,7 @@ class Procedure < ApplicationRecord
procedure.closed_mail = closed_mail&.dup
procedure.refused_mail = refused_mail&.dup
procedure.without_continuation_mail = without_continuation_mail&.dup
procedure.ask_birthday = false # see issue #4242
procedure.cloned_from_library = from_library
procedure.parent_procedure = self

View file

@ -121,12 +121,6 @@
%b
Si votre démarche sadresse indifféremment à une personne morale ou un particulier choisissez l'option "particuliers". Vous pourrez utilisez le champ SIRET directement dans le formulaire.
%ul#individual-with-siret
%li
.checkbox
%label
= f.check_box :ask_birthday
Demander la date de naissance.
.row
.col-md-6
%h4 Options avancées

View file

@ -448,6 +448,18 @@ describe Procedure do
it 'should have one administrateur' do
expect(subject.administrateurs).to eq([administrateur])
end
it 'should set ask_birthday to false' do
expect(subject.ask_birthday?).to eq(false)
end
end
context 'when the procedure is cloned from the library' do
let(:procedure) { create(:procedure, received_mail: received_mail, service: service, ask_birthday: true) }
it 'should set ask_birthday to false' do
expect(subject.ask_birthday?).to eq(false)
end
end
it 'should keep service_id' do