From 06744bb4c5777cae45dca3b0ed4826ab14cbc558 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Tue, 29 May 2007 00:11:56 +0000 Subject: Generated migrations include timestamps by default. Closes #8501. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6883 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../lib/rails_generator/generators/components/resource/USAGE | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'railties/lib/rails_generator/generators/components/resource') diff --git a/railties/lib/rails_generator/generators/components/resource/USAGE b/railties/lib/rails_generator/generators/components/resource/USAGE index 37faf2aba9..d396775a41 100644 --- a/railties/lib/rails_generator/generators/components/resource/USAGE +++ b/railties/lib/rails_generator/generators/components/resource/USAGE @@ -10,8 +10,11 @@ Description: As additional parameters, the generator will take attribute pairs described by name and type. These attributes will be used to prepopulate the migration to create the table for the model. For - example, "resource post title:string created_on:date body:text - published:boolean" will give you a Post model with those four attributes. + example, "resource post title:string body:text published:boolean" will + give you a Post model with those three attributes. + + By default, created_at and updated_at timestamps are added to migration + for you, so you needn't specify them by hand. You don't have to think up all attributes up front, but it's a good idea of adding just the baseline of what's needed to start really @@ -26,5 +29,5 @@ Description: Examples: ./script/generate resource post # no attributes - ./script/generate resource post title:string created_on:date body:text published:boolean - ./script/generate resource purchase order_id:integer created_at:datetime amount:decimal + ./script/generate resource post title:string body:text published:boolean + ./script/generate resource purchase order_id:integer amount:decimal -- cgit v1.2.3