Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add rake after_party:reset #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add rake after_party:reset #11

wants to merge 1 commit into from

Conversation

roberts1000
Copy link

This a great gem and I've been using it on one of our projects at work. The workflow we're using made it necessary to re run all of the tasks while we're in development (prior to launching the app) and we decided to implement a rake after_party:reset command to help. This saves us from having to rebuild the database or manually edit the task_records table each time we want to test something out.

Thanks for creating this gem and please let me know if there's anything you would like me to revise.

@roberts1000 roberts1000 reopened this Jul 17, 2015
@theSteveMitchell
Copy link
Owner

Thanks @roberts1000! I think I like this. I am a little concerned about someone accidentally using this in production, so I want to think on that before I merge it in. I also need to rebase #10 since there will be conflicts

@roberts1000 roberts1000 changed the title Add rake Add rake after_party:reset Jul 17, 2015
@roberts1000
Copy link
Author

Thanks for taking a look! I had the same concern, but eventually decided it was ok since the default rake tasks that ship with Rails don't try and prevent destructive behavior on production. (e.g. someone could accidentally run rake db:drop and nuke their production database.).

If you decide to bring it in, I was also thinking it might be nice to have a rake after_party:rerun command what would just execute after_party:reset and after_party:run in sequence. Every time I run rake after_party:reset I almost always immediately execute rake after_party:run. We wouldn't have to load the environment twice if we could reset+run in a single task and it would save some typing. repeat and rebuild were some other task names I was considering. I can create the task and update the pull request if you like the idea.

@michaelirey
Copy link
Collaborator

@roberts1000, I know this was posted some time ago. I like this idea. My only thought would be to not have this run if the environment == production. Would you still find it useful to get this PR merged?

@roberts1000
Copy link
Author

Hi! I still think it would be a nice feature to add. How about I enhance the task's default behavior to halt (and notify the user) if they're trying to run it in production, but allow the rake task to take a command line option (or look for an environment variable) to force it to run in production if they really want to? I'll do some general cleanup on the PR and rebase it as well.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants