An open API service indexing awesome lists of open source software.

https://github.com/tanakaworld/multi_seeds_rails

Advanced seed data handling for Rails, make it able to separate seeds.rb.
https://github.com/tanakaworld/multi_seeds_rails

rails seed seeds

Last synced: 2 months ago
JSON representation

Advanced seed data handling for Rails, make it able to separate seeds.rb.

Awesome Lists containing this project

README

        

# MultiSeedsRails

Advanced seed data handling for Rails, make it able to separate seeds.rb.

## Installation

```ruby
gem 'multi_seeds_rails'
```

## Usage

Add `db/seeds` directory.

```bash
mkdir db/seeds
```

Locate seed files under `db/seeds`.
The file name will be assigned as the task name.

```bash
touch db/seeds/dummy.rb
touch db/seeds/master.rb
```

```bash
bundle exec rake db:seed:dummy
# => will run `db/seeds/dummy.rb`

bundle exec rake db:seed:master
# => will run `db/seeds/master.rb`
```

Of course, you can run default seed.

```bash
bundle exec rake db:seed
# => will run `db/seeds.rb`
```

## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).