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
Ignore file fixtures on db:fixtures:load
#42153
Conversation
d68be01
to
f54cd5a
Compare
@@ -382,11 +382,14 @@ db_namespace = namespace :db do | |||
base_dir | |||
end | |||
|
|||
file_fixtures_dir = File.join(fixtures_dir, "files") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could be inlined on line 391. it's only needed in one branch of the if/else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ghiculescu addressed in 4cd5a9b.
Hey @kevinsjoberg, thanks for working on this. Some of the test failures seem intermittent, but this seems like it could be related: Can you please check / rebase against In terms of the solution, I think copying the approach from #36884 is fine. |
ac0a257
to
4cd5a9b
Compare
@ghiculescu you're absolutely right. The glob pattern was wrong. Fixed in c3359d2. |
This looks good, can you please squash your commits and add a changelog entry? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you squash your commits?
66dc5eb
to
9959272
Compare
9959272
to
f0f067a
Compare
@ghiculescu @rafaelfranca thanks for the reminder. 🙂 I've squashed the commits and added a changelog entry as suggested. See f0f067a. |
Ignore file fixtures on `db:fixtures:load`
Summary
In commit, 8ec085b, support for namespaced fixtures where introduced. When file fixtures where introduced their default path was set to
test/fixtures/files
. This caused any.yml
file placed intest/fixtures/files
to be treated as a test fixture. This was addressed in #36884. However, we're still unconditionally loading everything withintest/fixtures
when you runrake db:fixtures:load
.Other Information
The current solution is fairly naive, but I thought it's good enough as a starting point. I can iterate on the solution based on feedback. Some thoughts:
FILE_FIXTURES_DIR
given we're already supportingFIXTURES_DIR
?ActiveRecord::Tasks::DatabaseTasks.fixtures_path
. Does it make sense to define afile_fixtures_path
as well?