Merge pull request #8270 from tchak/fix-improuve-batch-dossiers-query
refactor(dossier): improuve dossiers_safe_scope on batch operation
This commit is contained in:
commit
b740c75f09
1 changed files with 3 additions and 3 deletions
|
@ -40,10 +40,10 @@ class BatchOperation < ApplicationRecord
|
||||||
}
|
}
|
||||||
|
|
||||||
def dossiers_safe_scope(dossier_ids = self.dossier_ids)
|
def dossiers_safe_scope(dossier_ids = self.dossier_ids)
|
||||||
query = Dossier.joins(:procedure)
|
query = instructeur
|
||||||
.where(procedure: { id: instructeur.procedures.ids })
|
.dossiers
|
||||||
.where(id: dossier_ids)
|
|
||||||
.visible_by_administration
|
.visible_by_administration
|
||||||
|
.where(id: dossier_ids)
|
||||||
case operation
|
case operation
|
||||||
when BatchOperation.operations.fetch(:archiver) then
|
when BatchOperation.operations.fetch(:archiver) then
|
||||||
query.not_archived.state_termine
|
query.not_archived.state_termine
|
||||||
|
|
Loading…
Reference in a new issue