This is a collection of useful Rake tasks for Rails.
Add these line to your app's Gemfile:
# Rake tasks for Rails
gem "rateaux"
Then call bundle install
.
Delete all data from the current database.
$ rake db:truncate
Delete all data and tables from the current database. This is similar to
db:drop
but it does not drop the database itself.
$ rake db:drop_tables
Add the # encoding: UTF-8
header to all ruby files in the project. Useful
before Ruby 2.
$ rake encoding_headers
Remove migrations then checkout a git branch.
$ rake checkout new_branch_name
This will:
- Roll back any migrations on your current branch which do not exist on the other branch
- Discard any changes to the db/schema.rb file
- Check out the other branch
- Run any new migrations existing in the other branch
- Update your test database
Empty the cache store.
$ rake cache_clear
Copy assets files with a digest (for example application-d45e…565.css
)
to their non-digested form (for example application.css
).
$ rake assets:copy_non_digested
View the database structure.
$ rake db:schema:view