Permalink
Browse files

Improve class overview for TableDefinition.

  • Loading branch information...
1 parent 867fc61 commit b810349c8dbc8d27602181832466bb2a518191a0 @FooBarWidget FooBarWidget committed Sep 13, 2008
Showing with 22 additions and 2 deletions.
  1. +22 −2 activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
@@ -275,9 +275,29 @@ def add_column_options!(sql, options)
end
end
- # Represents a SQL table in an abstract way.
- # Columns are stored as a ColumnDefinition in the +columns+ attribute.
+ # Represents the schema of an SQL table in an abstract way. This class
+ # provides methods for manipulating the schema representation.
+ #
+ # Inside migration files, the +t+ object in +create_table+ and
+ # +change_table+ is actually of this type:
+ #
+ # class SomeMigration < ActiveRecord::Migration
+ # def self.up
+ # create_table :foo do |t|
+ # puts t.class # => "ActiveRecord::ConnectionAdapters::TableDefinition"
+ # end
+ # end
+ #
+ # def self.down
+ # ...
+ # end
+ # end
+ #
+ # The table definitions
+ # The Columns are stored as a ColumnDefinition in the +columns+ attribute.
class TableDefinition
+ # An array of ColumnDefinition objects, representing the column changes
+ # that have been defined.
attr_accessor :columns
def initialize(base)

0 comments on commit b810349

Please sign in to comment.