Skip to content
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

Refactor environments and restoring #13

Merged
merged 1 commit into from
Jul 20, 2014
Merged

Refactor environments and restoring #13

merged 1 commit into from
Jul 20, 2014

Conversation

croaky
Copy link
Contributor

@croaky croaky commented Jul 20, 2014

Continue to not allow Parity to accidentally modify the developer's production
database.

Continue to not allow Parity to accidentally modify the developer's production
database.
@croaky
Copy link
Contributor Author

croaky commented Jul 20, 2014

@geoffharcourt @gabebw @derekprior Any of you have a moment to review this change?

I noticed that there was some unnecessary repetition in these files. I it almost a true refactoring. It changes the error message for when a user tries to restore a backup into their production database, which I explicitly don't want to support for paranoid reasons of potentially feeling awful for making it easy to mess up someone's production data.

@geoffharcourt
Copy link
Collaborator

+1 on preventing overwrites on production. I have had some cases where I've wanted to test data changes and then push those changes to production once I felt that they were working on staging, but I've settled on http://github.com/harrystech/seed_migration for that functionality instead.

@geoffharcourt
Copy link
Collaborator

If no one else using the gem has more than one environment that they are worried about overwriting, then I think the suggesting refactoring with the conditional for production is OK.

I only have one environment that I am worried about overwriting (production), but if developers have more than one production environment (we considered treating our demo environment as production-ish, for example) one approach I could see here would be to have two classes, Parity::Environment and Parity::ProductionEnvironment, the difference being that ProductionEnvrionment doesn't allow #restore. Unless any of you have an actual app in a situation that would require this approach, then I think it's better to proceed as @croaky suggests.

@croaky croaky merged commit b9e8b8d into master Jul 20, 2014
@croaky croaky deleted the dc-environment branch July 20, 2014 20:28
@croaky
Copy link
Contributor Author

croaky commented Jul 20, 2014

Okay, cool. Thanks, @geoffharcourt. Yeah, I don't know of projects that we have like that.

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