aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/CHANGELOG2
-rwxr-xr-xactiverecord/lib/active_record/fixtures.rb9
-rw-r--r--activerecord/lib/active_record/schema.rb38
-rw-r--r--activerecord/lib/active_record/version.rb2
4 files changed, 45 insertions, 6 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG
index e71474bd63..3a151289db 100644
--- a/activerecord/CHANGELOG
+++ b/activerecord/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Update/clean up documentation (rdoc)
+
* 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>]
* Change default logging colors to work on both white and black backgrounds. [Sam Stephenson]
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb
index ef4757fcee..1d38bab95b 100755
--- a/activerecord/lib/active_record/fixtures.rb
+++ b/activerecord/lib/active_record/fixtures.rb
@@ -2,12 +2,13 @@ require 'erb'
require 'yaml'
require 'csv'
-class YAML::Omap
- def keys; map { |k, v| k } end
- def values; map { |k, v| v } end
+module YAML #:nodoc:
+ class Omap #:nodoc:
+ def keys; map { |k, v| k } end
+ def values; map { |k, v| v } end
+ end
end
-
# Fixtures are a way of organizing data that you want to test against; in short, sample data. They come in 3 flavours:
#
# 1. YAML fixtures
diff --git a/activerecord/lib/active_record/schema.rb b/activerecord/lib/active_record/schema.rb
index 8527d54697..c986380853 100644
--- a/activerecord/lib/active_record/schema.rb
+++ b/activerecord/lib/active_record/schema.rb
@@ -1,8 +1,44 @@
module ActiveRecord
- # TODO: Document me!
+ # Allows programmers to programmatically define a schema in a portable
+ # DSL. This means you can define tables, indexes, etc. without using SQL
+ # directly, so your applications can more easily support multiple
+ # databases.
+ #
+ # Usage:
+ #
+ # ActiveRecord::Schema.define do
+ # create_table :authors do |t|
+ # t.column :name, :string, :null => false
+ # end
+ #
+ # add_index :authors, :name, :unique
+ #
+ # create_table :posts do |t|
+ # t.column :author_id, :integer, :null => false
+ # t.column :subject, :string
+ # t.column :body, :text
+ # t.column :private, :boolean, :default => false
+ # end
+ #
+ # add_index :posts, :author_id
+ # end
+ #
+ # ActiveRecord::Schema is only supported by database adapters that also
+ # support migrations, the two features being very similar.
class Schema < Migration
private_class_method :new
+ # Eval the given block. All methods available to the current connection
+ # adapter are available within the block, so you can easily use the
+ # database definition DSL to build up your schema (#create_table,
+ # #add_index, etc.).
+ #
+ # The +info+ hash is optional, and if given is used to define metadata
+ # about the current schema (like the schema's version):
+ #
+ # ActiveRecord::Schema.define(:version => 15) do
+ # ...
+ # end
def self.define(info={}, &block)
instance_eval(&block)
diff --git a/activerecord/lib/active_record/version.rb b/activerecord/lib/active_record/version.rb
index f28d506bd7..73493df534 100644
--- a/activerecord/lib/active_record/version.rb
+++ b/activerecord/lib/active_record/version.rb
@@ -1,5 +1,5 @@
module ActiveRecord
- module Version
+ module Version #:nodoc:
MAJOR = 1
MINOR = 11
TINY = 1