Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Resets (and if available, seeds) your databases.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 app_reset.gemspec
README.md

AppReset

Why?

Compared to db:reset:

db:reset resets your database from schema.rb - during early stage of development, the migration files are often edited directly to keep the sanity.

Compared to db:migrate:reset:

AppReset always calls db:create to ensure databases exist, and then calls db:migrate:reset. It also ensures seeds.rb will get called if you are in a rails engine environment.

AppReset basically replaces the following steps:

  • db:create
  • db:migrate:reset
  • RAILS_ENV=test db:migrate:reset
  • run seeds.rb from your rails engine

Installation

It is recommended you only include app_reset in your development environment:

gem 'app_reset', :group => :development

If you are using it in a rails engine, don't forget to require it:

require 'app_reset' if Rails.env.development?

Usage

Resets (and if available, seeds) your development and test databases via:

rake app:reset

License

This gem is released under the MIT License.

Author

Fred Wu

Something went wrong with that request. Please try again.