diff options
| author | Xinhui | 2017-03-06 15:39:33 +0100 |
|---|---|---|
| committer | Xinhui | 2017-03-06 15:39:39 +0100 |
| commit | daec6d64491babba57bdd2f6177610efdad11506 (patch) | |
| tree | 52acf8b939d4fd48e2625eab7d8d062611c6e67b /app/controllers | |
| parent | a0d2463c8eb3ca9c901ff67d0e1126dd7fa988f7 (diff) | |
| download | chouette-core-daec6d64491babba57bdd2f6177610efdad11506.tar.bz2 | |
ReferentialDestroyWorker
Refs #2695
Diffstat (limited to 'app/controllers')
| -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 |
