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)
|
||||
query = Dossier.joins(:procedure)
|
||||
.where(procedure: { id: instructeur.procedures.ids })
|
||||
.where(id: dossier_ids)
|
||||
query = instructeur
|
||||
.dossiers
|
||||
.visible_by_administration
|
||||
.where(id: dossier_ids)
|
||||
case operation
|
||||
when BatchOperation.operations.fetch(:archiver) then
|
||||
query.not_archived.state_termine
|
||||
|
|
Loading…
Reference in a new issue