Open deeeki opened 10 years ago
Well, thanks, but I'm not really a fan of clean_with only: ['foos']
syntax.
Actually I was also thinking of solving that API issue, and my take was like this: https://github.com/amatsuda/database_rewinder/compare/compat
You see the main code looks totally simple and beautiful by putting these :poop:s away, but I guess we need another handy interface for configuring :except
and :only
before pushing them to the origin.
Thoughts?
Thanks for your comment. Yeah, separating modules looks fine.
I think the simplest way is;
DatabaseRewinder.only = ['foos'] # and also set to cleaners
in most cases it will work good. But in case of changing options in a particular test, users have to take care of current @except
value (kept or overwritten, also have to set empty @except
depending on DBR's spec).
so another ides is;
DatabaseRewinder.cleaner_options = only: ['foos'], except: []
this is kinda verbose but flexible and users can always write with just 1 line.
This change enables the method to receive as the following
while keeping compatibility.
for DatabaseRewinder first-choice users :dash: