diff options
author | Ian C. Anderson <ian@iancanderson.com> | 2016-08-17 10:25:04 -0400 |
---|---|---|
committer | Ian C. Anderson <ian@iancanderson.com> | 2016-08-17 18:19:59 -0400 |
commit | fbaa5e390f018615bedb5e7c0f7ec2df24840963 (patch) | |
tree | 0c89c1d5943ddbdf792cc61c75d91ee71f161e59 /actionpack/lib/action_controller/base.rb | |
parent | f857e1fd8c5bf74fd1d4449e8336a262630e217e (diff) | |
download | rails-fbaa5e390f018615bedb5e7c0f7ec2df24840963.tar.gz rails-fbaa5e390f018615bedb5e7c0f7ec2df24840963.tar.bz2 rails-fbaa5e390f018615bedb5e7c0f7ec2df24840963.zip |
i18n documentation for required belongs_to message
When you don't explicitly provide `optional: true` to a `belongs_to`
definition, rails adds a validation to ensure presence of the
`belongs_to` validation.
However, when the validation is added, it is added with a message key of
`:required`, which was not documented in the "Translations for Active
Record Models" section of the i18n guides.
Here are the lines that add the `:required` message:
https://github.com/rails/rails/blob/c3e3577f9d5058382504773bf0d32afa15cb131e/activerecord/lib/active_record/associations/builder/belongs_to.rb#L136-L138
This commit adds the "non-optional association" validation to the table,
so rails users know how to override the message for this validation. The
default message is "must exist".
Diffstat (limited to 'actionpack/lib/action_controller/base.rb')
0 files changed, 0 insertions, 0 deletions