diff options
| author | Zog | 2018-04-30 09:15:54 +0200 | 
|---|---|---|
| committer | Zog | 2018-05-07 15:03:07 +0200 | 
| commit | 7b336d1e47164a15c273f0899e8710e4fee273f8 (patch) | |
| tree | 2fe44c50cf876fa150f9a97c6d4f64389a79c6bb /app/controllers | |
| parent | 657fea85b193fb9908dcaa42391bec230e93d857 (diff) | |
| download | chouette-core-7b336d1e47164a15c273f0899e8710e4fee273f8.tar.bz2 | |
Trigger compliance checks after imports
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 | 
