From 48523f662b62f228224706dd1e8c38336fa0ecbd Mon Sep 17 00:00:00 2001 From: joshknowles Date: Wed, 28 Nov 2007 18:12:15 +0000 Subject: [PATCH] Initial import git-svn-id: https://db-populate.googlecode.com/svn/trunk@2 f88e3d0c-0140-0410-ae37-a51a81e078ed --- tasks/populate.rake | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tasks/populate.rake diff --git a/tasks/populate.rake b/tasks/populate.rake new file mode 100644 index 0000000..57f0064 --- /dev/null +++ b/tasks/populate.rake @@ -0,0 +1,7 @@ +namespace :db do + desc "Loads initial database models for the current environment." + task :populate => :environment do + Dir[File.join(RAILS_ROOT, 'db', 'fixtures', '*.rb')].sort.each { |fixture| load fixture } + Dir[File.join(RAILS_ROOT, 'db', 'fixtures', RAILS_ENV, '*.rb')].sort.each { |fixture| load fixture } + end +end