aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlban Peignier2018-01-10 17:34:44 +0100
committerAlban Peignier2018-01-10 17:43:03 +0100
commit0bc79220fbce288102ea470fa57f865ee8fdfb47 (patch)
tree7f3ba79ebb0a9e831749b69cdf03e4b4ec7c6e56
parent6ea5fe58761b2549def5249b769dfea9df3b4fde (diff)
downloadchouette-core-0bc79220fbce288102ea470fa57f865ee8fdfb47.tar.bz2
Aesthetic changes in STIF Organisation.after_create callback. Refs #54995499-workgroup-model
-rw-r--r--config/initializers/stif.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/config/initializers/stif.rb b/config/initializers/stif.rb
index 428869be6..a73e4931b 100644
--- a/config/initializers/stif.rb
+++ b/config/initializers/stif.rb
@@ -1,3 +1,4 @@
+# coding: utf-8
Rails.application.config.to_prepare do
Organisation.after_create do |organisation|
line_referential = LineReferential.find_by(name: "CodifLigne")
@@ -6,20 +7,19 @@ Rails.application.config.to_prepare do
line_referential.organisations << organisation
stop_area_referential.organisations << organisation
- workgroup = Workgroup.find_or_create_by(name: "Gestion de l'offre théorique IDFm") do |wkgrp|
- wkgrp.line_referential = line_referential
- wkgrp.stop_area_referential = stop_area_referential
- end
+ 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 |wkbnch|
- wkbnch.line_referential = line_referential
- wkbnch.stop_area_referential = stop_area_referential
- wkbnch.objectid_format = Workbench.objectid_format.stif_netex
+ 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
-
- workbench.update( workgroup: workgroup )
end
end unless Rails.env.test?