Each instance of an active record class is tied to a specific row in a database.
一个活动记录的每个实例都关系到数据库内的特定行。
Let's take at look at a simple (and partial) implementation of the active record design pattern.
让我们先来看看活动记录设计模式的一个简单的部分实现。
You use the active record pattern to wrap relational database persistence methods in domain classes.
活动记录模式则可用来在域类内包装关系数据库持久性方法。
Whereas the singleton implementation uses the subclass's class name, other patterns (such as active record, covered later) need to reference other static properties.
尽管单例实现使用的是子类的类名,其他的模式(比如稍后介绍的活动记录模式)需要引用其他的静态属性。
The second feature that simplifies debugging is the Active Record console.
能够简化调试的第二个功能是Active Record 控制台。
Active Record users do not always need to change model objects as the data model changes.
Active Record用户并不总需要随着数据模型的改变而改变模型对象。
There are many Active Record updates in this release including the introduction of nested transactions.
该发布中有很多Active Record更新,包括嵌套事务的引入。
You can find a list of the Active Record model validations that can be defined in the class scope here.
在这里可以找到可以在类范围中定义的Active Record模型检验列表。
The framework queries two sources of metadata: the Active Record model and a custom metadata file for each model object.
框架查询两个元数据源:活动记录模型和每个模型对象的定制元数据文件。
It does not currently include Active Record, the powerful domain model library on which Rails database model objects are built.
当前的版本还未包括Active Record,这是Rails数据库模型对象赖以为根本的强大的领域模型类库。
Active Record associates a class with a table and dynamically adds an attribute to each class for every column in the database.
Active Record将类和表关联起来,并按照数据库中的每一列给每个类动态地添加一个属性。
Active Record simply overrides method_missing and parses the method name at run time to determine whether the method name is valid.
Active Record越过method_missing并在运行时解析该方法名以确定该方法名是否有效。
Through some nifty lexical analysis, Active Record is able to determine that the ORDER class will map to the ORDERS table in the database.
通过一些漂亮的词汇分析,Active Record能够判断出,Order类将映射到数据库中的ORDERS表。
For standard validations like checking the name, length and format of an attribute, we can make use of validations provided by Active Record.
对于标准的检验(比如检查属性的名称、长度和格式),可以使用Active Record提供的检验。
In this case, we will follow the Active Record pattern and wrap a database row with a class capable of all database operations. Its code is shown below.
在本例中,我们将遵循active Record模式并用能够执行所有数据库操作的类封装数据库行。
Active Record Query Interface 3.0 - Pratik Naik demonstrates ActiveRecord's finder methods and shows how a number of techniques are being deprecated in Rails 3.1.
Pratik Naik演示了ActiveRecord的finder方法,以及一些在Rails 3.1中将不再支持的技巧。
Scaffolding quickly put an Active Record class online by providing standardized actions for listing, showing, creating, updating, and destroying objects of the class.
scaffolding通过提供列出、显示、创建、更新和销毁类的对象的标准化动作,快速地使一个Active record类上线。
If you've not seen Active Record — the underlying persistence layer in Rails — before, I recommend that you take a look first at this earlier Rails article in the Crossing borders series.
如果以前没有学习过活动记录——Rails底层的持久性层,我建议您先阅读跨越边界系列中以前的这篇Rails文章。
The Rails gem is quite a thin and simple component that orchestrates behind the scenes the seamless integration of all other components; two of the most visible being Active Record and Action View.
Railsgem是一个相当简单的组件,它在幕后无缝地集成所有其他组件;最明显的两个组件是Active Record和Action View。
The Rails gem is quite a thin and simple component that orchestrates behind the scenes the seamless integration of all other components; two of the most visible being Active Record and Action View.
Railsgem是一个相当简单的组件,它在幕后无缝地集成所有其他组件;最明显的两个组件是Active Record和Action View。
应用推荐