Merge pull request #4078 from betagouv/remove-individual-with-siret

Suppression du code de `individual_with_siret` sur `Procedure`
This commit is contained in:
Pierre de La Morinerie 2019-07-11 12:13:13 +02:00 committed by GitHub
commit 3e43ef029e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 4 additions and 5 deletions

View file

@ -269,7 +269,7 @@ class Admin::ProceduresController < AdminController
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, :individual_with_siret, :ask_birthday, :path)
params.require(:procedure).permit(*editable_params, :duree_conservation_dossiers_dans_ds, :duree_conservation_dossiers_hors_ds, :for_individual, :ask_birthday, :path)
end
end
end

View file

@ -24,7 +24,6 @@ class ProcedureDashboard < Administrate::BaseDashboard
created_at: Field::DateTime,
updated_at: Field::DateTime,
for_individual: Field::Boolean,
individual_with_siret: Field::Boolean,
auto_archive_on: Field::DateTime,
published_at: Field::DateTime,
hidden_at: Field::DateTime,
@ -75,7 +74,6 @@ class ProcedureDashboard < Administrate::BaseDashboard
:types_de_champ_private,
:types_de_piece_justificative,
:for_individual,
:individual_with_siret,
:auto_archive_on,
:gestionnaires,
:initiated_mail_template,

View file

@ -3,6 +3,8 @@ require Rails.root.join('lib', 'percentile')
class Procedure < ApplicationRecord
MAX_DUREE_CONSERVATION = 36
self.ignored_columns = [:individual_with_siret]
has_many :types_de_piece_justificative, -> { ordered }, inverse_of: :procedure, dependent: :destroy
has_many :types_de_champ, -> { root.public_only.ordered }, inverse_of: :procedure, dependent: :destroy
has_many :types_de_champ_private, -> { root.private_only.ordered }, class_name: 'TypeDeChamp', inverse_of: :procedure, dependent: :destroy

View file

@ -30,7 +30,7 @@ class ProcedurePresentation < ApplicationRecord
)
end
if !procedure.for_individual || (procedure.for_individual && procedure.individual_with_siret)
if !procedure.for_individual
fields.push(
field_hash('SIREN', 'etablissement', 'entreprise_siren'),
field_hash('Forme juridique', 'etablissement', 'entreprise_forme_juridique'),

View file

@ -323,7 +323,6 @@ describe Admin::ProceduresController, type: :controller do
it { expect(subject.direction).to eq procedure_params[:direction] }
it { expect(subject.for_individual).not_to eq procedure_params[:for_individual] }
it { expect(subject.individual_with_siret).not_to eq procedure_params[:individual_with_siret] }
end
end
end