Skip to content

Conversation

@deeeki
Copy link
Collaborator

@deeeki deeeki commented May 29, 2014

This change enables the method to receive as the following

DatabaseRewinder.clean_with except: ["foos"]

while keeping compatibility.

DatabaseRewinder.clean_with :truncation, except: ["foos"]

for DatabaseRewinder first-choice users 💨

@amatsuda
Copy link
Owner

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 💩s away, but I guess we need another handy interface for configuring :except and :only before pushing them to the origin.
Thoughts?

@deeeki
Copy link
Collaborator Author

deeeki commented May 30, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants