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