Skip to content
This repository
Browse code

Update/clean up ActiveRecord documentation (rdoc)

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2650 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit bcd0968a6f643efc016cb425995a58b7d9261de6 1 parent 1c057b7
Jamis Buck authored
2  activerecord/CHANGELOG
... ...
@@ -1,5 +1,7 @@
1 1
 *SVN*                                                                                                                   
2 2
 
  3
+* Update/clean up documentation (rdoc)
  4
+
3 5
 * PostgreSQL sequence support.  Use set_sequence_name in your model class to specify its primary key sequence.  #2292 [Rick Olson <technoweenie@gmail.com>, Robby Russell <robby@planetargon.com>]
4 6
 
5 7
 * Change default logging colors to work on both white and black backgrounds. [Sam Stephenson]
9  activerecord/lib/active_record/fixtures.rb
@@ -2,12 +2,13 @@
2 2
 require 'yaml'
3 3
 require 'csv'
4 4
 
5  
-class YAML::Omap
6  
-  def keys;   map { |k, v| k } end
7  
-  def values; map { |k, v| v } end
  5
+module YAML #:nodoc:
  6
+  class Omap #:nodoc:
  7
+    def keys;   map { |k, v| k } end
  8
+    def values; map { |k, v| v } end
  9
+  end
8 10
 end
9 11
 
10  
-
11 12
 # Fixtures are a way of organizing data that you want to test against; in short, sample data. They come in 3 flavours:
12 13
 #
13 14
 #   1.  YAML fixtures
38  activerecord/lib/active_record/schema.rb
... ...
@@ -1,8 +1,44 @@
1 1
 module ActiveRecord
2  
-  # TODO: Document me!
  2
+  # Allows programmers to programmatically define a schema in a portable
  3
+  # DSL. This means you can define tables, indexes, etc. without using SQL
  4
+  # directly, so your applications can more easily support multiple
  5
+  # databases.
  6
+  #
  7
+  # Usage:
  8
+  #
  9
+  #   ActiveRecord::Schema.define do
  10
+  #     create_table :authors do |t|
  11
+  #       t.column :name, :string, :null => false
  12
+  #     end
  13
+  #
  14
+  #     add_index :authors, :name, :unique
  15
+  #
  16
+  #     create_table :posts do |t|
  17
+  #       t.column :author_id, :integer, :null => false
  18
+  #       t.column :subject, :string
  19
+  #       t.column :body, :text
  20
+  #       t.column :private, :boolean, :default => false
  21
+  #     end
  22
+  #
  23
+  #     add_index :posts, :author_id
  24
+  #   end
  25
+  #
  26
+  # ActiveRecord::Schema is only supported by database adapters that also
  27
+  # support migrations, the two features being very similar.
3 28
   class Schema < Migration
4 29
     private_class_method :new
5 30
 
  31
+    # Eval the given block. All methods available to the current connection
  32
+    # adapter are available within the block, so you can easily use the
  33
+    # database definition DSL to build up your schema (#create_table,
  34
+    # #add_index, etc.).
  35
+    #
  36
+    # The +info+ hash is optional, and if given is used to define metadata
  37
+    # about the current schema (like the schema's version):
  38
+    #
  39
+    #   ActiveRecord::Schema.define(:version => 15) do
  40
+    #     ...
  41
+    #   end
6 42
     def self.define(info={}, &block)
7 43
       instance_eval(&block)
8 44
 
2  activerecord/lib/active_record/version.rb
... ...
@@ -1,5 +1,5 @@
1 1
 module ActiveRecord
2  
-  module Version
  2
+  module Version #:nodoc:
3 3
     MAJOR = 1
4 4
     MINOR = 11
5 5
     TINY  = 1

0 notes on commit bcd0968

Please sign in to comment.
Something went wrong with that request. Please try again.