提交 e54c225b 编写于 作者: G Gaurish Sharma

[Fixes #11734]Correct Association Basics Guide on has_and_belongs_to_many[ci skip]

Done the following changes:
 1. Replace uniq call in example with autosave as uniq is not supported
 on has_and_belongs_to_many
 2. Add :readonly option to list of supported call as per
 [EdgeApi](http://edgeapi.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#method-i-has_and_belongs_to_many)
上级 71f51264
......@@ -1944,8 +1944,8 @@ While Rails uses intelligent defaults that will work well in most situations, th
```ruby
class Parts < ActiveRecord::Base
has_and_belongs_to_many :assemblies, uniq: true,
read_only: true
has_and_belongs_to_many :assemblies, autosave: true,
readonly: true
end
```
......@@ -1957,6 +1957,7 @@ The `has_and_belongs_to_many` association supports these options:
* `:foreign_key`
* `:join_table`
* `:validate`
* `:readonly`
##### `:association_foreign_key`
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册