Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore file fixtures on db:fixtures:load #42153

Merged
merged 1 commit into from Jun 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -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)
Expand Down