提交 df52eee1 编写于 作者: L Luka Marčetić
上级 3ec6cc70
......@@ -188,11 +188,11 @@ end
```
It's also possible to override the column that should be used as the table's
primary key using the `ActiveRecord::Base.set_primary_key` method:
primary key using the `ActiveRecord::Base.primary_key=` method:
```ruby
class Product < ActiveRecord::Base
set_primary_key "product_id"
self.primary_key = "product_id"
end
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册