From 73357c5144848fcc553ba9f82e20c950e58b4293 Mon Sep 17 00:00:00 2001 From: Simon Lehericey Date: Thu, 21 Sep 2017 15:27:14 +0200 Subject: [PATCH] [Fix #503] Dossier: Remove waiting for gestionnaire scope --- app/facades/admin_procedures_show_facades.rb | 4 ---- app/models/dossier.rb | 3 --- app/views/admin/procedures/show.html.haml | 4 ---- spec/facades/admin_procedures_show_facades_spec.rb | 6 ------ 4 files changed, 17 deletions(-) diff --git a/app/facades/admin_procedures_show_facades.rb b/app/facades/admin_procedures_show_facades.rb index 0bdc084d1..b099f5c43 100644 --- a/app/facades/admin_procedures_show_facades.rb +++ b/app/facades/admin_procedures_show_facades.rb @@ -32,10 +32,6 @@ class AdminProceduresShowFacades dossiers.size end - def dossiers_waiting_gestionnaire_total - dossiers.waiting_for_gestionnaire.size - end - def dossiers_termine_total dossiers.where(state: :termine).size end diff --git a/app/models/dossier.rb b/app/models/dossier.rb index 9049e7255..6da2b984e 100644 --- a/app/models/dossier.rb +++ b/app/models/dossier.rb @@ -13,7 +13,6 @@ class Dossier < ActiveRecord::Base BROUILLON = %w(draft) NOUVEAUX = %w(initiated) OUVERT = %w(updated replied) - WAITING_FOR_GESTIONNAIRE = %w(updated) EN_CONSTRUCTION = %w(initiated updated replied) EN_INSTRUCTION = %w(received) EN_CONSTRUCTION_OU_INSTRUCTION = EN_CONSTRUCTION + EN_INSTRUCTION @@ -50,7 +49,6 @@ class Dossier < ActiveRecord::Base scope :state_not_brouillon, -> { where.not(state: BROUILLON) } scope :state_nouveaux, -> { where(state: NOUVEAUX) } scope :state_ouvert, -> { where(state: OUVERT) } - scope :state_waiting_for_gestionnaire, -> { where(state: WAITING_FOR_GESTIONNAIRE) } scope :state_en_construction, -> { where(state: EN_CONSTRUCTION) } scope :state_en_instruction, -> { where(state: EN_INSTRUCTION) } scope :state_en_construction_ou_instruction, -> { where(state: EN_CONSTRUCTION_OU_INSTRUCTION) } @@ -65,7 +63,6 @@ class Dossier < ActiveRecord::Base scope :all_state, -> { not_archived.state_not_brouillon.order_by_updated_at(:asc) } scope :nouveaux, -> { not_archived.state_nouveaux.order_by_updated_at(:asc) } scope :ouvert, -> { not_archived.state_ouvert.order_by_updated_at(:asc) } - scope :waiting_for_gestionnaire, -> { not_archived.state_waiting_for_gestionnaire.order_by_updated_at(:asc) } scope :a_instruire, -> { not_archived.state_a_instruire.order_by_updated_at(:asc) } scope :termine, -> { not_archived.state_termine.order_by_updated_at(:asc) } scope :downloadable, -> { state_not_brouillon.order_by_updated_at(:asc) } diff --git a/app/views/admin/procedures/show.html.haml b/app/views/admin/procedures/show.html.haml index 3ebdd8db0..8d564cb22 100644 --- a/app/views/admin/procedures/show.html.haml +++ b/app/views/admin/procedures/show.html.haml @@ -98,10 +98,6 @@ %div = @facade.dossiers_total - %h4.text-danger Attente Accompagnateur - %div - = @facade.dossiers_waiting_gestionnaire_total - %h4.text-success Terminé %div = @facade.dossiers_termine_total diff --git a/spec/facades/admin_procedures_show_facades_spec.rb b/spec/facades/admin_procedures_show_facades_spec.rb index d37b1607c..781fb9393 100644 --- a/spec/facades/admin_procedures_show_facades_spec.rb +++ b/spec/facades/admin_procedures_show_facades_spec.rb @@ -50,12 +50,6 @@ describe AdminProceduresShowFacades do it { is_expected.to eq(4) } end - describe 'dossiers_waiting_gestionnaire_total' do - subject { super().dossiers_waiting_gestionnaire_total } - - it { is_expected.to eq(1) } - end - describe 'dossiers_termine_total' do subject { super().dossiers_termine_total }