Oct 10, 2009

Some useful rake commands to remember

Just a short note on rake commands. It is used in the command line and can call objects in the rails application. This will be very handy especially if you need to create some functions in your app and call it from the command line.

To start with, some rake commands that you'll remember after starting your first app.

I can see how many Lines Of Code (LOC) for my application, just by running:
rake stats


A migration file is an atomic change and undo change similar to changes made in database structure.


We'll need this everytime we create new migration file.
rake db:migrate
rake db:migrate_plugins RAILS_ENV=production


Better still, use the -T option to get rake to describe a list of possible actions
rake -T



And for more specific commands on db

rake -T db








No comments:

Post a Comment