Skip to content

Instantly share code, notes, and snippets.

View miyamae's full-sized avatar

Tatsuya Miyamae miyamae

View GitHub Profile
@miyamae
miyamae / factory_girl.rake
Last active December 20, 2015 01:49 — forked from brenttheisen/factory_girl.rake
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.
#
# 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