1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #24333 from y-yagi/add_index_errors_option_to_example

add `:index_errors` option to example [ci skip]
This commit is contained in:
Jon Moss 2016-03-26 22:01:35 -04:00
commit 763ff54df0

View file

@ -538,13 +538,13 @@
* Add option to index errors in nested attributes * Add option to index errors in nested attributes
For models which have nested attributes, errors within those models will For models which have nested attributes, errors within those models will
now be indexed if :index_errors is specified when defining a now be indexed if `:index_errors` is specified when defining a
has_many relationship, or if its set in the global config. has_many relationship, or if its set in the global config.
Example: Example:
class Guitar < ActiveRecord::Base class Guitar < ActiveRecord::Base
has_many :tuning_pegs has_many :tuning_pegs, index_errors: true
accepts_nested_attributes_for :tuning_pegs accepts_nested_attributes_for :tuning_pegs
end end