remove for_procedure
This commit is contained in:
parent
e7bc53237b
commit
6055fd1b0b
3 changed files with 4 additions and 22 deletions
|
@ -56,7 +56,7 @@ module Instructeurs
|
|||
|
||||
@a_suivre_dossiers = current_instructeur
|
||||
.dossiers
|
||||
.for_procedure(procedure)
|
||||
.where(groupe_instructeur_id: groupe_instructeur_ids)
|
||||
.without_followers
|
||||
.en_cours
|
||||
|
||||
|
@ -69,17 +69,17 @@ module Instructeurs
|
|||
|
||||
@termines_dossiers = current_instructeur
|
||||
.dossiers
|
||||
.for_procedure(procedure)
|
||||
.where(groupe_instructeur_id: groupe_instructeur_ids)
|
||||
.termine
|
||||
|
||||
@all_state_dossiers = current_instructeur
|
||||
.dossiers
|
||||
.for_procedure(procedure)
|
||||
.where(groupe_instructeur_id: groupe_instructeur_ids)
|
||||
.all_state
|
||||
|
||||
@archived_dossiers = current_instructeur
|
||||
.dossiers
|
||||
.for_procedure(procedure)
|
||||
.where(groupe_instructeur_id: groupe_instructeur_ids)
|
||||
.archived
|
||||
|
||||
@dossiers = case statut
|
||||
|
|
|
@ -312,7 +312,6 @@ class Dossier < ApplicationRecord
|
|||
.where.not(user: users_who_submitted)
|
||||
end
|
||||
|
||||
scope :for_procedure, -> (procedure) { includes(:user, :groupe_instructeur).where(groupe_instructeurs: { procedure: procedure }) }
|
||||
scope :for_api_v2, -> { includes(procedure: [:administrateurs, :attestation_template], etablissement: [], individual: [], traitements: []) }
|
||||
|
||||
scope :with_notifications, -> do
|
||||
|
|
|
@ -1154,23 +1154,6 @@ describe Dossier do
|
|||
end
|
||||
end
|
||||
|
||||
describe '#for_procedure' do
|
||||
let!(:procedure_1) { create(:procedure) }
|
||||
let!(:procedure_2) { create(:procedure) }
|
||||
|
||||
let!(:dossier_1_1) { create(:dossier, procedure: procedure_1) }
|
||||
let!(:dossier_1_2) { create(:dossier, procedure: procedure_1) }
|
||||
let!(:dossier_2_1) { create(:dossier, procedure: procedure_2) }
|
||||
|
||||
before do
|
||||
gi_1_2 = procedure_1.groupe_instructeurs.create(label: 2)
|
||||
gi_1_2.dossiers << dossier_1_2
|
||||
end
|
||||
|
||||
it { expect(Dossier.for_procedure(procedure_1)).to contain_exactly(dossier_1_1, dossier_1_2) }
|
||||
it { expect(Dossier.for_procedure(procedure_2)).to contain_exactly(dossier_2_1) }
|
||||
end
|
||||
|
||||
describe '#notify_draft_not_submitted' do
|
||||
let!(:user1) { create(:user) }
|
||||
let!(:user2) { create(:user) }
|
||||
|
|
Loading…
Reference in a new issue