Rateaux
This is a collection of usefull Rake tasks for Rails.
Install
Add this line to your Gemfile to install it with Bundler:
gem "rateaux"
Then type bundle install
in a terminal.
Rake Tasks
Truncate
Truncate all data from the current SQL database. This removes all the data but keeps the tables.
$ rake db:truncate
Delete
Delete all data from the current SQL database. This removes all the data and the tables.
$ rake db:delete
Encoding headers
Add the # encoding: UTF-8
header to all ruby files in the project. Useful before Ruby 2.
$ rake encoding_headers
Checkout
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
Cache clear
Empty the cache store.
$ rake cache_clear
Assets Copy Non Digested
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