lib/named_seeds/railtie.rb in named_seeds-1.0.0 vs lib/named_seeds/railtie.rb in named_seeds-1.0.1
- old
+ new
@@ -18,13 +18,15 @@
rake_tasks do
load "named_seeds/railties/databases.rake"
end
def load_seed
- setup_test_environment
- clean_test_database
- load_all_seeds
+ if seed_file
+ setup_test_environment
+ clean_test_database
+ load_all_seeds
+ end
end
protected
@@ -47,11 +49,14 @@
end
def load_all_seeds
Rails.application.load_seed if config.named_seeds.app_load_seed
config.named_seeds.engines_with_load_seed.each { |engine| engine.load_seed }
- seed_file = Rails.application.paths["db/test/seeds"].existent.first
- load(seed_file) if seed_file
+ load seed_file
+ end
+
+ def seed_file
+ Rails.application.paths["db/test/seeds"].existent.first
end
end
end