(PROJECT NEEDS NEW MAINTAINER) Seed Fu-like functionality for Mongoid
Go to file
John Bintz 9feb8e6459 Merge pull request #3 from pblesi/master
fix seed_once! functionality
2017-04-11 07:30:24 -04:00
config add some tests and the ability to create objects via hashes 2013-03-27 10:41:04 -04:00
features fix seed_once! functionality 2014-12-14 12:23:13 -06:00
lib add quiet flag to seed output 2014-12-14 23:17:10 -06:00
.gitignore initial commit 2013-02-20 13:09:29 -05:00
Gemfile add some tests and the ability to create objects via hashes 2013-03-27 10:41:04 -04:00
Guardfile add some tests and the ability to create objects via hashes 2013-03-27 10:41:04 -04:00
LICENSE.txt initial commit 2013-02-20 13:09:29 -05:00
Rakefile add some tests and the ability to create objects via hashes 2013-03-27 10:41:04 -04:00
README.md add ability to seed through code 2013-02-24 16:39:36 -05:00
seed-fu-mongoid.gemspec add some tests and the ability to create objects via hashes 2013-03-27 10:41:04 -04:00

I missed Seed Fu when I was working on a Mongoid app, so I hacked this together in about 20 minutes. No tests whatsoever but it works with my very simple Seed Fu-like seed data, so if you like it, contribute some tests!

Usage

Seed files in db/fixtures/*.rb:

PermissionType.seed do |s|
  s.id = 1
  s.type = 'Users'
end

PermissionType.seed do |s|
  s.id = 2
  s.type = 'Sites'
end

Then rake db:seed_fu if you're in Rails.

Simple!

Capistrano

require 'seed-fu-mongoid/capistrano' to have your data get re-seeded on deploy.

Cucumber/RSpec

SeedFuMongoid.seed