db_populate/tasks/populate.rake

14 lines
500 B
Ruby
Raw Normal View History

2008-09-13 13:28:17 +00:00
amespace :db do
desc "Loads initial database models for the current environment."
task :populate => :environment do
2008-09-13 13:28:17 +00:00
require File.join(File.dirname(__FILE__), '/../../lib', 'create_or_update')
Dir[File.join(RAILS_ROOT, 'db', 'populate', '*.rb')].sort.each do |fixture|
load fixture
puts "Loaded #{fixture}"
end
Dir[File.join(RAILS_ROOT, 'db', 'populate', RAILS_ENV, '*.rb')].sort.each do |fixture|
load fixture
puts "Loaded #{fixture}"
end
end
2008-09-13 13:28:17 +00:00
end