Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[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
  • Loading branch information...
commit e54c225b16abaee9c59c187955dd574b8b541c58 1 parent 71f5126
Gaurish Sharma gaurish authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 guides/source/
5 guides/source/
@@ -1944,8 +1944,8 @@ While Rails uses intelligent defaults that will work well in most situations, th
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
@@ -1957,6 +1957,7 @@ The `has_and_belongs_to_many` association supports these options:
* `:foreign_key`
* `:join_table`
* `:validate`
+* `:readonly`
##### `:association_foreign_key`
Please sign in to comment.
Something went wrong with that request. Please try again.