add bulk action 'follow'
This commit is contained in:
parent
177dec2bdb
commit
25a7fa5a34
10 changed files with 126 additions and 5 deletions
|
@ -17,9 +17,10 @@
|
|||
|
||||
class BatchOperation < ApplicationRecord
|
||||
enum operation: {
|
||||
accepter: 'accepter',
|
||||
archiver: 'archiver',
|
||||
passer_en_instruction: 'passer_en_instruction',
|
||||
accepter: 'accepter'
|
||||
follow: 'follow',
|
||||
passer_en_instruction: 'passer_en_instruction'
|
||||
}
|
||||
|
||||
has_many :dossiers, dependent: :nullify
|
||||
|
@ -58,6 +59,8 @@ class BatchOperation < ApplicationRecord
|
|||
query.state_en_construction
|
||||
when BatchOperation.operations.fetch(:accepter) then
|
||||
query.state_en_instruction
|
||||
when BatchOperation.operations.fetch(:follow) then
|
||||
query.without_followers
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -74,6 +77,8 @@ class BatchOperation < ApplicationRecord
|
|||
dossier.passer_en_instruction(instructeur: instructeur)
|
||||
when BatchOperation.operations.fetch(:accepter)
|
||||
dossier.accepter(instructeur: instructeur, motivation: motivation, justificatif: justificatif_motivation)
|
||||
when BatchOperation.operations.fetch(:follow)
|
||||
instructeur.follow(dossier)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue