Skip to content

Seed file

A seed file contains all instructions to populate a seed.

Parsers

There are currently 3 available parsers.

  • Ruby
  • Yaml
  • Json

The Ruby parser is recommended as it allows full control over the seeded data. The Yaml and Json parsers provide a non-technical-friendly approach to authoring seed files, but they have limitations, such as looping, and custom logic.

File Extension

The file extension is: .rb

Skeleton

A Ruby seed must contain a class named DataSeeder and an instance method named seed.

my_seed.rb
class DataSeeder
def seed
# data to seed here
end
end