diff options
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/imports_controller.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/controllers/imports_controller.rb b/app/controllers/imports_controller.rb index 8d7a723a0..b98d7da8d 100644 --- a/app/controllers/imports_controller.rb +++ b/app/controllers/imports_controller.rb @@ -4,6 +4,7 @@ class ImportsController < ChouetteController include IevInterfaces skip_before_action :authenticate_user!, only: [:download] defaults resource_class: Import::Base, collection_name: 'imports', instance_name: 'import' + before_action :notify_parents def download if params[:token] == resource.token_download @@ -18,7 +19,7 @@ class ImportsController < ChouetteController def index_model Import::Workbench end - + def build_resource @import ||= Import::Workbench.new(*resource_params) do |import| import.workbench = parent @@ -43,4 +44,10 @@ class ImportsController < ChouetteController } ) end + + def notify_parents + if Rails.env.development? + ParentNotifier.new(Import::Base).notify_when_finished + end + end end |
