diff options
author | Mehmet Emin İNAÇ <mehmetemininac@gmail.com> | 2015-04-10 22:11:48 +0300 |
---|---|---|
committer | Mehmet Emin İNAÇ <mehmetemininac@gmail.com> | 2015-04-11 23:24:36 +0300 |
commit | 29986b0d41da553536319d376c482a4598e4dd46 (patch) | |
tree | 3c7da130c799b984bdb730f1550af59338f04a9f /activerecord/lib | |
parent | f0d3c920a5aeb3babc35500e13288e148238b65e (diff) | |
download | rails-29986b0d41da553536319d376c482a4598e4dd46.tar.gz rails-29986b0d41da553536319d376c482a4598e4dd46.tar.bz2 rails-29986b0d41da553536319d376c482a4598e4dd46.zip |
Missing note on validates_presence_of validation [ci skip]
Without this note, someone can misunderstand the usage of validates_presence_of method
add missing note for the validates_presence_of
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. |