Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • C chouette-core
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 36
    • Merge requests 36
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Administrator
  • chouette-core
  • Wiki
  • Seed database

Seed database · Changes

Page history
Retrieve chouette-core wiki content authored May 06, 2018 by Alban Peignier's avatar Alban Peignier
Show whitespace changes
Inline Side-by-side
Showing with 32 additions and 0 deletions
+32 -0
  • Seed-database.md Seed-database.md +32 -0
  • No files found.
Seed-database.md 0 → 100644
View page @ f9aa7ef7
Database seeds are managed by [seedbank](https://github.com/james2m/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`:
```ruby
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
```
Clone repository

Coding Conventions