From 29986b0d41da553536319d376c482a4598e4dd46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Emin=20=C4=B0NA=C3=87?= Date: Fri, 10 Apr 2015 22:11:48 +0300 Subject: 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 --- activerecord/lib/active_record/validations/presence.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activerecord') 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: # * :message - A custom error message (default is: "can't be blank"). # * :on - Specifies the contexts where this validation is active. -- cgit v1.2.3