mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Removing db/seeds.rb is fine. Don't blow up.
This commit is contained in:
@@ -488,7 +488,7 @@ module Rails
|
||||
# Blog::Engine.load_seed
|
||||
def load_seed
|
||||
seed_file = paths["db/seeds"].existent.first
|
||||
load(seed_file) if File.exist?(seed_file)
|
||||
load(seed_file) if seed_file && File.exist?(seed_file)
|
||||
end
|
||||
|
||||
# Add configured load paths to ruby load paths and remove duplicates.
|
||||
|
||||
@@ -455,12 +455,18 @@ module RailtiesTest
|
||||
|
||||
Rails.application.load_seed
|
||||
assert Rails.application.config.app_seeds_loaded
|
||||
assert_raise(NoMethodError) do Bukkits::Engine.config.bukkits_seeds_loaded end
|
||||
assert_raise(NoMethodError) { Bukkits::Engine.config.bukkits_seeds_loaded }
|
||||
|
||||
Bukkits::Engine.load_seed
|
||||
assert Bukkits::Engine.config.bukkits_seeds_loaded
|
||||
end
|
||||
|
||||
test "skips nonexistent seed data" do
|
||||
FileUtils.rm "#{app_path}/db/seeds.rb"
|
||||
boot_rails
|
||||
assert_nil Rails.application.load_seed
|
||||
end
|
||||
|
||||
test "using namespace more than once on one module should not overwrite _railtie method" do
|
||||
@plugin.write "lib/bukkits.rb", <<-RUBY
|
||||
module AppTemplate
|
||||
|
||||
Reference in New Issue
Block a user