-
-
Save miyamae/6052148 to your computer and use it in GitHub Desktop.
Rake task that loads factories using factory_girl in to the current environment's database.
Intended to be a replacement for Rail's rake db:fixtures:load.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # To install copy this file in to <RAILS_APP>/lib/tasks/factory_girl.rake. | |
| # To use run: rake db:factory_girl:load | |
| # | |
| namespace :db do | |
| namespace :factory_girl do | |
| desc 'Load Factory Girl factories into the current environment\'s database.' | |
| task :load => :environment do | |
| FactoryGirl.factories.map(&:name).each do |name| | |
| FactoryGirl.create name | |
| end | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment