aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/README
diff options
context:
space:
mode:
authorrick <rick@spacemonkey.local>2008-05-05 23:19:21 -0700
committerrick <rick@spacemonkey.local>2008-05-05 23:19:21 -0700
commit0052938ac5b8894b27fdb9f27b1ed39f0a9ea176 (patch)
treef714643a4043d9fb73b39ec2a114d18f5deeffdd /activerecord/README
parenteacb5cf0cab6447db78085c8bda6c94dd329ce6b (diff)
parent3cffe92ff066c2b35eef409547db93652c5cccfc (diff)
downloadrails-0052938ac5b8894b27fdb9f27b1ed39f0a9ea176.tar.gz
rails-0052938ac5b8894b27fdb9f27b1ed39f0a9ea176.tar.bz2
rails-0052938ac5b8894b27fdb9f27b1ed39f0a9ea176.zip
Merge commit 'core/master'
Diffstat (limited to 'activerecord/README')
-rwxr-xr-xactiverecord/README22
1 files changed, 22 insertions, 0 deletions
diff --git a/activerecord/README b/activerecord/README
index 7204b44ec4..ff3f55ee8a 100755
--- a/activerecord/README
+++ b/activerecord/README
@@ -164,6 +164,28 @@ A short rundown of the major features:
ActiveRecord::Base.logger = Log4r::Logger.new("Application Log")
+* Database agnostic schema management with Migrations
+
+ class AddSystemSettings < ActiveRecord::Migration
+ def self.up
+ create_table :system_settings do |t|
+ t.string :name
+ t.string :label
+ t.text :value
+ t.string :type
+ t.integer :position
+ end
+
+ SystemSetting.create :name => "notice", :label => "Use notice?", :value => 1
+ end
+
+ def self.down
+ drop_table :system_settings
+ end
+ end
+
+ {Learn more}[link:classes/ActiveRecord/Migration.html]
+
== Simple example (1/2): Defining tables and classes (using MySQL)
Data definitions are specified only in the database. Active Record queries the database for