lib/tasks/seed.rake in seedbank-0.0.9 vs lib/tasks/seed.rake in seedbank-0.1.1
- old
+ new
@@ -1,13 +1,15 @@
namespace :db do
+ Rake::Task.extend(Seedbank::Task)
+ Rake::Application.send(:include, Seedbank::TaskManager)
include Seedbank::DSL
- base_dependencies = ['db:seed:original']
+ base_dependencies = ['db:seed:original']
override_dependency = []
-
common_dependencies = []
+
# Create seed tasks for all the seeds in seeds_path and add them to the dependency
# list along with the original db/seeds.rb.
Dir.glob(File.join(seeds_root, '*.seeds.rb')).each do |seed_file|
common_dependencies << define_seed_task(seed_file)
end
@@ -20,10 +22,10 @@
# for the environment
Dir[seeds_root + '/*/'].each do |e|
environment = File.basename(e)
environment_dependencies = []
- Dir.glob(File.join(seeds_root, environment, '*.seeds.rb')).each do |seed_file|
+ Dir.glob(File.join(seeds_root, environment, '*.seeds.rb')).sort.each do |seed_file|
environment_dependencies << define_seed_task(seed_file)
end
desc <<-EOT
Load the seed data from db/seeds.rb, db/seeds/*.seeds.rb and db/seeds/#{environment}/*.seeds.rb.