aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorHongli Lai (Phusion) <hongli@phusion.nl>2008-09-18 13:03:49 +0200
committerHongli Lai (Phusion) <hongli@phusion.nl>2008-09-18 13:03:49 +0200
commitcedea3a04cfc914d040d7fdb1c18c9c8ddcf569e (patch)
treef2aa72dbd260fb738c2807d2503d0fd0c6b1ba92 /activerecord
parentc2494a294851a7e93e5644159c6ee781a0ae1cd1 (diff)
downloadrails-cedea3a04cfc914d040d7fdb1c18c9c8ddcf569e.tar.gz
rails-cedea3a04cfc914d040d7fdb1c18c9c8ddcf569e.tar.bz2
rails-cedea3a04cfc914d040d7fdb1c18c9c8ddcf569e.zip
Improve documentation for create_table.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb10
1 files changed, 8 insertions, 2 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 bececf82a0..c29c1562b4 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
@@ -31,19 +31,25 @@ module ActiveRecord
# See the concrete implementation for details on the expected parameter values.
def columns(table_name, name = nil) end
- # Creates a new table
+ # Creates a new table with the name +table_name+. +table_name+ may either
+ # be a String or a Symbol.
+ #
# There are two ways to work with +create_table+. You can use the block
# form or the regular form, like this:
#
# === Block form
- # # create_table() yields a TableDefinition instance
+ # # 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
#
# === Regular form
+ # # Creates a table called 'suppliers' with no columns.
# create_table(:suppliers)
+ # # Add a column to 'suppliers'.
# add_column(:suppliers, :name, :string, {:limit => 60})
#
# The +options+ hash can include the following keys: