Skip to content

Commit

Permalink
[Fixes #11734]Correct Association Basics Guide on has_and_belongs_to_…
Browse files Browse the repository at this point in the history
…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)
  • Loading branch information
gaurish committed Aug 3, 2013
1 parent 71f5126 commit e54c225
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions guides/source/association_basics.md
Expand Up @@ -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
```

Expand All @@ -1957,6 +1957,7 @@ The `has_and_belongs_to_many` association supports these options:
* `:foreign_key`
* `:join_table`
* `:validate`
* `:readonly`

##### `:association_foreign_key`

Expand Down

0 comments on commit e54c225

Please sign in to comment.