diff options
| author | Luc Donnet | 2018-02-19 11:04:29 +0100 |
|---|---|---|
| committer | Luc Donnet | 2018-02-19 11:04:29 +0100 |
| commit | 7b17deff51545358009cb417cbb9d796565e7540 (patch) | |
| tree | a43a5586ad39d838dd607e600dbc15ff18a58ab3 /config/initializers/stif.rb | |
| parent | 89428163fc93a7e09ebb0ca47939f8558afeb5eb (diff) | |
| parent | 5f6008d165df4499319a2121a71842657d6ac3c9 (diff) | |
| download | chouette-core-7b17deff51545358009cb417cbb9d796565e7540.tar.bz2 | |
Merge branch 'master' into 0000-docker
Diffstat (limited to 'config/initializers/stif.rb')
| -rw-r--r-- | config/initializers/stif.rb | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/config/initializers/stif.rb b/config/initializers/stif.rb index eb918131b..a73e4931b 100644 --- a/config/initializers/stif.rb +++ b/config/initializers/stif.rb @@ -1,12 +1,22 @@ +# coding: utf-8 Rails.application.config.to_prepare do Organisation.after_create do |organisation| line_referential = LineReferential.find_by(name: "CodifLigne") stop_area_referential = StopAreaReferential.find_by(name: "Reflex") - organisation.workbenches.find_or_create_by(name: "Gestion de l'offre") do |workbench| - workbench.line_referential = line_referential - workbench.stop_area_referential = stop_area_referential - workbench.objectid_format = Workbench.objectid_format.stif_netex + line_referential.organisations << organisation + stop_area_referential.organisations << organisation + + workgroup = Workgroup.find_or_create_by(name: "Gestion de l'offre théorique IDFm") do |w| + w.line_referential = line_referential + w.stop_area_referential = stop_area_referential + end + + workbench = organisation.workbenches.find_or_create_by(name: "Gestion de l'offre") do |w| + w.line_referential = line_referential + w.stop_area_referential = stop_area_referential + w.objectid_format = Workbench.objectid_format.stif_netex + w.workgroup = workgroup Rails.logger.debug "Create Workbench for #{organisation.name}" end |
