0.02
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
A Sequel extension to make seeds/fixtures manageable like migrations
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 4.49.0
 Project Readme

Sequel::Seed Gem Version Build Status codecov Codacy Badge

A Sequel extension to make seeds/fixtures manageable like migrations

Usage

Create a seed file (eg. /path/to/seeds/20150928000000_initial_seed.rb)

Sequel.seed(:development, :test) do # Applies only to "development" and "test" environments
  def run
    [
      ['USD', 'United States dollar'],
      ['BRL', 'Brazilian real']
    ].each do |abbr, name|
      Currency.create abbr: abbr, name: name
    end
  end
end

Set the environment

Sequel::Seed.setup :development

Load the extension

require 'sequel'
require 'sequel/extensions/seed'

Sequel.extension :seed

Apply the seeds/fixtures

DB = Sequel.connect(...)
Sequel::Seeder.apply(DB, "/path/to/seeds")

For more information, please check the project website.

Limitations

  • JSON and YAML files don't work with associations
  • Only timestamped seed/fixture files

What's next?

Work with Model's associations inside JSON & YAML files

Support

If you need any help (or have found any bug 🐞), please post it on /issues. Thank you!

License

MIT License © Ewerton Carlos Assis