diff options
Diffstat (limited to 'app/controllers/workbenches_controller.rb')
| -rw-r--r-- | app/controllers/workbenches_controller.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/controllers/workbenches_controller.rb b/app/controllers/workbenches_controller.rb index f3dc0c9b3..44c6b174b 100644 --- a/app/controllers/workbenches_controller.rb +++ b/app/controllers/workbenches_controller.rb @@ -18,9 +18,11 @@ class WorkbenchesController < BreadcrumbController def delete_referentials referentials = resource.referentials.where(id: params[:referentials]) - if referentials.destroy_all - flash[:notice] = t('notice.referentials.deleted') + referentials.each do |referential| + ReferentialDestroyWorker.perform_async(referential.id) + referential.update_attribute(:ready, false) end + flash[:notice] = t('notice.referentials.deleted') redirect_to resource end |
