diff options
author | Ryan Bigg <radarlistener@gmail.com> | 2009-06-22 15:02:37 +1000 |
---|---|---|
committer | Ryan Bigg <radarlistener@gmail.com> | 2009-06-22 15:03:03 +1000 |
commit | f73ee375a6d616df97f6d8f36465e2d91757172a (patch) | |
tree | 3394105b67308564b10ffbc2744599abe41adc19 | |
parent | 3009fcffa53cef26b1f753261e27806f047aaddb (diff) | |
download | rails-f73ee375a6d616df97f6d8f36465e2d91757172a.tar.gz rails-f73ee375a6d616df97f6d8f36465e2d91757172a.tar.bz2 rails-f73ee375a6d616df97f6d8f36465e2d91757172a.zip |
Added example of using shorthand in create_table.
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb index ff63ea3a2e..a41912a703 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -41,11 +41,19 @@ module ActiveRecord # # create_table() passes a TableDefinition object to the block. # # This form will not only create the table, but also columns for the # # table. + # # create_table(:suppliers) do |t| # t.column :name, :string, :limit => 60 # # Other fields here # end # + # === Block form, with shorthand + # # You can also use the column types as method calls, rather than calling the column method. + # create_table(:suppliers) do |t| + # t.string :name, :limit => 60 + # # Other fields here + # end + # # === Regular form # # Creates a table called 'suppliers' with no columns. # create_table(:suppliers) |