diff options
| author | Zog | 2018-04-30 14:22:53 +0200 |
|---|---|---|
| committer | Zog | 2018-05-07 15:03:07 +0200 |
| commit | af49fd1021ee6b22fd8ca6c6592c5f7d64c23aa0 (patch) | |
| tree | 60d770778dbccb6b7deb31247c9d2462a53f19da /app/models | |
| parent | f0bbc8d002f845efe0bfecf37477e96c84a6b41c (diff) | |
| download | chouette-core-af49fd1021ee6b22fd8ca6c6592c5f7d64c23aa0.tar.bz2 | |
Better views
Diffstat (limited to 'app/models')
| -rw-r--r-- | app/models/import/resource.rb | 6 | ||||
| -rw-r--r-- | app/models/workbench.rb | 2 | ||||
| -rw-r--r-- | app/models/workgroup.rb | 6 |
3 files changed, 8 insertions, 6 deletions
diff --git a/app/models/import/resource.rb b/app/models/import/resource.rb index 27dc367a8..2c7889240 100644 --- a/app/models/import/resource.rb +++ b/app/models/import/resource.rb @@ -18,16 +18,14 @@ class Import::Resource < ApplicationModel def next_step if root_import.class == Import::Workbench - # XXX - # return unless netex_import&.successful? + return unless netex_import&.successful? if workbench.import_compliance_control_set_id.present? && workbench_import_control_set.nil? ComplianceControlSetCopyWorker.perform_async workbench.import_compliance_control_set_id, referential_id return end - # XXX - # return if workbench_import_control_set && !workbench_import_control_set.successful? + return if workbench_import_control_set && !workbench_import_control_set.successful? if workgroup.import_compliance_control_set_id.present? && workgroup_import_control_set.nil? ComplianceControlSetCopyWorker.perform_async workgroup.import_compliance_control_set_id, referential_id diff --git a/app/models/workbench.rb b/app/models/workbench.rb index 14406c9f4..d99197b47 100644 --- a/app/models/workbench.rb +++ b/app/models/workbench.rb @@ -52,7 +52,7 @@ class Workbench < ApplicationModel end def import_compliance_control_set - ComplianceControlSet.find(import_compliance_control_set_id) + import_compliance_control_set_id && ComplianceControlSet.find(import_compliance_control_set_id) end private diff --git a/app/models/workgroup.rb b/app/models/workgroup.rb index 9ae5e564d..6a1746eb8 100644 --- a/app/models/workgroup.rb +++ b/app/models/workgroup.rb @@ -26,6 +26,10 @@ class Workgroup < ApplicationModel def import_compliance_control_set_id # XXX - 1 + nil + end + + def import_compliance_control_set + import_compliance_control_set_id && ComplianceControlSet.find(import_compliance_control_set_id) end end |
