Skip to content

Commit f5c092c

Browse files
authored
Merge pull request rails#42153 from kevinsjoberg/ignore-file-fixtures-on-load
Ignore file fixtures on `db:fixtures:load`
2 parents ee99c89 + f0f067a commit f5c092c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

actionpack/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
* Ignore file fixtures on `db:fixtures:load`
2+
3+
*Kevin Sjöberg*
4+
15
* Fix ActionController::Live controller test deadlocks by removing the body buffer size limit for tests.
26

37
*Dylan Thacker-Smith*

activerecord/lib/active_record/railties/databases.rake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,9 @@ db_namespace = namespace :db do
385385
fixture_files = if ENV["FIXTURES"]
386386
ENV["FIXTURES"].split(",")
387387
else
388-
# The use of String#[] here is to support namespaced fixtures.
389-
Dir["#{fixtures_dir}/**/*.yml"].map { |f| f[(fixtures_dir.size + 1)..-5] }
388+
files = Dir[File.join(fixtures_dir, "**/*.{yml}")]
389+
files.reject! { |f| f.start_with?(File.join(fixtures_dir, "files")) }
390+
files.map! { |f| f[fixtures_dir.to_s.size..-5].delete_prefix("/") }
390391
end
391392

392393
ActiveRecord::FixtureSet.create_fixtures(fixtures_dir, fixture_files)

0 commit comments

Comments
 (0)