lib/tasks/seed.rake in seedbank-0.3.0.pre2 vs lib/tasks/seed.rake in seedbank-0.3.0
- old
+ new
@@ -26,11 +26,13 @@
override_dependency << "db:seed:#{environment}" if defined?(Rails) && Rails.env == environment
end
if Rails.version > '4'
original_seeds_file = Rails.application.paths["db/seeds.rb"].existent.first
- else
+ elsif Rails.version > '3'
original_seeds_file = Rails.application.paths["db/seeds"].existent.first
+ else
+ original_seeds_file = Rails.root.join("db","seeds").children.first.to_s
end
define_seed_task original_seeds_file, :original if original_seeds_file
end
# Override db:seed to run all the common and environments seeds plus the original db:seed.