Database seeds are managed by seedbank in the standard db/seed directory.
chouette-core only provides development seeds. Sub-projects should use the environment mechanism provided by seedbank to complete and provide their own data.
You can seed the database by running: rake db:seed
Create a specific seed
You can use helpers provided by seed_helpers:
require_relative 'seed_helpers'
organisation = Organisation.seed_by(code: "acmee") do |o|
o.name = 'ACMEE Organisation'
end
stop_area_referential = StopAreaReferential.seed_by(name: "ACMEE StopPoints") do |r|
r.objectid_format = "netex"
r.add_member organisation, owner: true
end
line_referential = LineReferential.seed_by(name: "ACMEE Lines") do |r|
r.objectid_format = "netex"
r.add_member organisation, owner: true
end
workgroup = Workgroup.seed_by(name: "ACMEE Workgroup") do |w|
w.line_referential = line_referential
w.stop_area_referential = stop_area_referential
end
A sample seeds file is provided in db/seeds/development/default.seeds.rb.sample
Please note:
the easiest and fastest way to get an "up and running" workbench, with its organization and all related models, is to use the "Sign Up" feature.