aboutsummaryrefslogtreecommitdiffstats
path: root/config/initializers/stif.rb
blob: 6a79cadc89d9fabca949bd06e246c2006a899d60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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

      Rails.logger.debug "Create Workbench for #{organisation.name}"
    end
  end
end unless Rails.env.test?