diff options
author | Robin Dupret <robin.dupret@gmail.com> | 2015-04-11 22:43:36 +0200 |
---|---|---|
committer | Robin Dupret <robin.dupret@gmail.com> | 2015-04-11 22:43:36 +0200 |
commit | d21c688522e9454c023039d3c2281a4ab4f9cf1b (patch) | |
tree | a3af2f32f2bc2684ba4ab4893cdcfa63d894bf04 /activerecord/lib | |
parent | cab53734e8c30f36310224f9a87a02e0c4e98dbe (diff) | |
parent | 29986b0d41da553536319d376c482a4598e4dd46 (diff) | |
download | rails-d21c688522e9454c023039d3c2281a4ab4f9cf1b.tar.gz rails-d21c688522e9454c023039d3c2281a4ab4f9cf1b.tar.bz2 rails-d21c688522e9454c023039d3c2281a4ab4f9cf1b.zip |
Merge pull request #19721 from vngrs/validates_presence_of_missing_note
Missing note on validates_presence_of validation [ci skip]
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/validations/presence.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/validations/presence.rb b/activerecord/lib/active_record/validations/presence.rb index 75d5bd5a35..a9b791397b 100644 --- a/activerecord/lib/active_record/validations/presence.rb +++ b/activerecord/lib/active_record/validations/presence.rb @@ -43,6 +43,10 @@ module ActiveRecord # deletes the associated object, thus putting the parent object into an invalid # state. # + # NOTE: This validation will not fail while using it with an association + # if the latter was assigned but not valid. If you want to ensure that + # it is both present and valid, you also need to use +validates_associated+. + # # Configuration options: # * <tt>:message</tt> - A custom error message (default is: "can't be blank"). # * <tt>:on</tt> - Specifies the contexts where this validation is active. |