aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source
diff options
context:
space:
mode:
authorGaurish Sharma <contact@gaurishsharma.com>2013-08-03 19:44:40 +0530
committerGaurish Sharma <contact@gaurishsharma.com>2013-08-03 20:08:20 +0530
commite54c225b16abaee9c59c187955dd574b8b541c58 (patch)
treeabf16421c3d4078433ad8d7081769e81b060bc36 /guides/source
parent71f512646a447e4b15c613d35842728e6b8dddb1 (diff)
downloadrails-e54c225b16abaee9c59c187955dd574b8b541c58.tar.gz
rails-e54c225b16abaee9c59c187955dd574b8b541c58.tar.bz2
rails-e54c225b16abaee9c59c187955dd574b8b541c58.zip
[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)
Diffstat (limited to 'guides/source')
-rw-r--r--guides/source/association_basics.md5
1 files changed, 3 insertions, 2 deletions
diff --git a/guides/source/association_basics.md b/guides/source/association_basics.md
index e6a66f3fa1..9b80a65a44 100644
--- a/guides/source/association_basics.md
+++ b/guides/source/association_basics.md
@@ -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`