Skip to content

Commit

Permalink
rephrase how the verbose methods in a migration work
Browse files Browse the repository at this point in the history
  • Loading branch information
vijaydev committed Aug 14, 2011
1 parent 3c57155 commit ac4dc5e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions railties/guides/source/migrations.textile
Expand Up @@ -471,8 +471,8 @@ By default migrations tell you exactly what they're doing and how long it took.

Several methods are provided that allow you to control all this:

* +suppress_messages+ suppresses any output generated by its block
* +say+ outputs text (the second argument controls whether it is indented or not)
* +suppress_messages+ takes a block as an argument and suppresses any output generated by the block.
* +say+ takes a message argument and outputs it as is. A second boolean argument can be passed to specify whether to indent or not.
* +say_with_time+ outputs text along with how long it took to run its block. If the block returns an integer it assumes it is the number of rows affected.

For example, this migration
Expand Down Expand Up @@ -510,7 +510,7 @@ generates the following output
20080906170109 CreateProducts: migrated (10.0097s)
</shell>

If you just want Active Record to shut up then running +rake db:migrate VERBOSE=false+ will suppress any output.
If you just want Active Record to shut up then running +rake db:migrate VERBOSE=false+ will suppress all output.

h3. Using Models in Your Migrations

Expand Down

0 comments on commit ac4dc5e

Please sign in to comment.