Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
6fbd548b
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
6fbd548b
编写于
6月 03, 2011
作者:
W
Waynn Lue
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add a missing "the" and normalize the use of periods.
上级
74f9a462
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
9 addition
and
9 deletion
+9
-9
activerecord/README.rdoc
activerecord/README.rdoc
+9
-9
未找到文件。
activerecord/README.rdoc
浏览文件 @
6fbd548b
...
...
@@ -3,7 +3,7 @@
Active Record connects classes to relational database tables to establish an
almost zero-configuration persistence layer for applications. The library
provides a base class that, when subclassed, sets up a mapping between the new
class and an existing table in the database. In context of an application,
class and an existing table in the database. In
the
context of an application,
these classes are commonly referred to as *models*. Models can also be
connected to other models; this is done by defining *associations*.
...
...
@@ -70,7 +70,7 @@ A short rundown of some of the major features:
{Learn more}[link:classes/ActiveRecord/Validations.html]
* Callbacks available for the entire life cycle (instantiation, saving, destroying, validating, etc.)
* Callbacks available for the entire life cycle (instantiation, saving, destroying, validating, etc.)
.
class Person < ActiveRecord::Base
before_destroy :invalidate_payment_plan
...
...
@@ -80,7 +80,7 @@ A short rundown of some of the major features:
{Learn more}[link:classes/ActiveRecord/Callbacks.html]
* Observers that react to changes in a model
* Observers that react to changes in a model
.
class CommentObserver < ActiveRecord::Observer
def after_create(comment) # is called just after Comment#save
...
...
@@ -91,7 +91,7 @@ A short rundown of some of the major features:
{Learn more}[link:classes/ActiveRecord/Observer.html]
* Inheritance hierarchies
* Inheritance hierarchies
.
class Company < ActiveRecord::Base; end
class Firm < Company; end
...
...
@@ -101,7 +101,7 @@ A short rundown of some of the major features:
{Learn more}[link:classes/ActiveRecord/Base.html]
* Transactions
* Transactions
.
# Database transaction
Account.transaction do
...
...
@@ -112,7 +112,7 @@ A short rundown of some of the major features:
{Learn more}[link:classes/ActiveRecord/Transactions/ClassMethods.html]
* Reflections on columns, associations, and aggregations
* Reflections on columns, associations, and aggregations
.
reflection = Firm.reflect_on_association(:clients)
reflection.klass # => Client (class)
...
...
@@ -121,7 +121,7 @@ A short rundown of some of the major features:
{Learn more}[link:classes/ActiveRecord/Reflection/ClassMethods.html]
* Database abstraction through simple adapters
* Database abstraction through simple adapters
.
# connect to SQLite3
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => "dbfile.sqlite3")
...
...
@@ -141,13 +141,13 @@ A short rundown of some of the major features:
SQLite3[link:classes/ActiveRecord/ConnectionAdapters/SQLite3Adapter.html].
* Logging support for Log4r[http://log4r.sourceforge.net] and Logger[http://www.ruby-doc.org/stdlib/libdoc/logger/rdoc]
* Logging support for Log4r[http://log4r.sourceforge.net] and Logger[http://www.ruby-doc.org/stdlib/libdoc/logger/rdoc]
.
ActiveRecord::Base.logger = Logger.new(STDOUT)
ActiveRecord::Base.logger = Log4r::Logger.new("Application Log")
* Database agnostic schema management with Migrations
* Database agnostic schema management with Migrations
.
class AddSystemSettings < ActiveRecord::Migration
def self.up
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录