v2.2.1 can overwrite DatabaseCleaner.strategy
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 62/100
Research direction
Read lib/database_cleaner/active_record.rb at the linked line, then reproduce the reported RSpec configuration with the SQLite3 memory database. Done means an explicitly configured DatabaseCleaner.strategy remains :truncation rather than being overwritten with :transaction.
Written by the indexing model from the issue text.
Description
On v2.2.0 of this gem, this config worked fine in my app:
RSpec.configure do |config|
# ...
DatabaseCleaner.strategy = :truncation
end
After upgrading to v2.2.1, my strategy was getting overwritten and set to transaction. I only noticed this because that strategy has never worked properly with the Sqlite3 memory database I use for this library, which meant that the overwrite was causing some errors. I was able to restore the original behavior with:
RSpec.configure do |config|
# ...
config.before(:suite) do
DatabaseCleaner.strategy = :truncation
end
end
My best guess is that https://github.com/fatkodima/database_cleaner-active_record/blob/63aec2d25d6cac1322df926689ec33daf491de0e/lib/database_cleaner/active_record.rb#L10 needs to be ||= instead of =, but I defer to the subject matter experts.
- Dominant language
- Ruby
- Stars
- 76
- Forks
- 76
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DatabaseCleaner/database_cleaner-active_record
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
DatabaseCleaner/database_cleaner-active_record#128 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
DatabaseCleaner/database_cleaner-active_record#127 · 3 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
DatabaseCleaner/database_cleaner-active_record#110 · 1 comment ·
All issues in DatabaseCleaner/database_cleaner-active_record
Similar issues
-
user-reported
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Kong/developer.konghq.com#7316 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
TheOdinProject/curriculum#31408 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
notch8/utk_knapsack#148 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Homebrew/homebrew-cask#288729 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100