Skip to content

Commit

Permalink
Merge pull request #42153 from kevinsjoberg/ignore-file-fixtures-on-load
Browse files Browse the repository at this point in the history
Ignore file fixtures on `db:fixtures:load`
  • Loading branch information
rafaelfranca committed Jun 23, 2021
1 parent 9040eb1 commit 8877b88
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions actionpack/CHANGELOG.md
@@ -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*
Expand Down
5 changes: 3 additions & 2 deletions activerecord/lib/active_record/railties/databases.rake
Expand Up @@ -413,8 +413,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)
Expand Down

0 comments on commit 8877b88

Please sign in to comment.