Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added example of using shorthand in create_table.

  • Loading branch information...
commit f73ee375a6d616df97f6d8f36465e2d91757172a 1 parent 3009fcf
@radar radar authored
View
8 activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
@@ -41,11 +41,19 @@ def columns(table_name, name = nil) end
# # 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)
Please sign in to comment.
Something went wrong with that request. Please try again.