Ignore file fixtures on `db:fixtures:load`
This commit is contained in:
parent
3a98e7da62
commit
f0f067af78
|
@ -1,3 +1,7 @@
|
|||
* Ignore file fixtures on `db:fixtures:load`
|
||||
|
||||
*Kevin Sjöberg*
|
||||
|
||||
* Fix ActionController::Live controller test deadlocks by removing the body buffer size limit for tests.
|
||||
|
||||
*Dylan Thacker-Smith*
|
||||
|
|
|
@ -385,8 +385,9 @@ db_namespace = namespace :db do
|
|||
fixture_files = if ENV["FIXTURES"]
|
||||
ENV["FIXTURES"].split(",")
|
||||
else
|
||||
# The use of String#[] here is to support namespaced fixtures.
|
||||
Dir["#{fixtures_dir}/**/*.yml"].map { |f| f[(fixtures_dir.size + 1)..-5] }
|
||||
files = Dir[File.join(fixtures_dir, "**/*.{yml}")]
|
||||
files.reject! { |f| f.start_with?(File.join(fixtures_dir, "files")) }
|
||||
files.map! { |f| f[fixtures_dir.to_s.size..-5].delete_prefix("/") }
|
||||
end
|
||||
|
||||
ActiveRecord::FixtureSet.create_fixtures(fixtures_dir, fixture_files)
|
||||
|
|
Loading…
Reference in New Issue