Remove brouillons deleted dossiers
This commit is contained in:
parent
8dcbe5f47c
commit
60cb9bcf09
3 changed files with 11 additions and 2 deletions
|
@ -116,7 +116,7 @@ module Instructeurs
|
||||||
def deleted_dossiers
|
def deleted_dossiers
|
||||||
@procedure = procedure
|
@procedure = procedure
|
||||||
@deleted_dossiers = @procedure
|
@deleted_dossiers = @procedure
|
||||||
.deleted_dossiers.where.not(state: :brouillon)
|
.deleted_dossiers
|
||||||
.order(:dossier_id)
|
.order(:dossier_id)
|
||||||
.page params[:page]
|
.page params[:page]
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
namespace :after_party do
|
||||||
|
desc 'Deployment task: cleanup_deleted_dossiers'
|
||||||
|
task cleanup_deleted_dossiers: :environment do
|
||||||
|
puts "Running deploy task 'cleanup_deleted_dossiers'"
|
||||||
|
|
||||||
|
DeletedDossier.where(state: :brouillon).destroy_all
|
||||||
|
|
||||||
|
AfterParty::TaskRecord.create version: '20200326133630'
|
||||||
|
end
|
||||||
|
end
|
|
@ -413,7 +413,6 @@ describe Instructeurs::ProceduresController, type: :controller do
|
||||||
let(:instructeur) { create(:instructeur) }
|
let(:instructeur) { create(:instructeur) }
|
||||||
let(:procedure) { create(:procedure, instructeurs: [instructeur]) }
|
let(:procedure) { create(:procedure, instructeurs: [instructeur]) }
|
||||||
let(:deleted_dossier) { create(:deleted_dossier, procedure: procedure, state: :en_construction) }
|
let(:deleted_dossier) { create(:deleted_dossier, procedure: procedure, state: :en_construction) }
|
||||||
let!(:deleted_dossier_brouillon) { create(:deleted_dossier, procedure: procedure, state: :brouillon) }
|
|
||||||
|
|
||||||
before do
|
before do
|
||||||
sign_in(instructeur.user)
|
sign_in(instructeur.user)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue