aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2014-01-13 11:25:58 +0100
committerYves Senn <yves.senn@gmail.com>2014-01-13 11:25:58 +0100
commit8c0d5e0d1cfcec4ae6618e4ae8286421ff0f92fa (patch)
tree201e88c509ff941ee0d88163ccf03d1120dd5581 /activemodel/lib
parent3a521bc7d18304a7377807f99014b327ea6f8ffa (diff)
downloadrails-8c0d5e0d1cfcec4ae6618e4ae8286421ff0f92fa.tar.gz
rails-8c0d5e0d1cfcec4ae6618e4ae8286421ff0f92fa.tar.bz2
rails-8c0d5e0d1cfcec4ae6618e4ae8286421ff0f92fa.zip
doc proc/lambda arg on inclusion validation. Closes #13689. [ci skip]
Diffstat (limited to 'activemodel/lib')
-rw-r--r--activemodel/lib/active_model/validations/inclusion.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/validations/inclusion.rb b/activemodel/lib/active_model/validations/inclusion.rb
index 24337614c5..b344095807 100644
--- a/activemodel/lib/active_model/validations/inclusion.rb
+++ b/activemodel/lib/active_model/validations/inclusion.rb
@@ -29,7 +29,8 @@ module ActiveModel
# * <tt>:in</tt> - An enumerable object of available items. This can be
# supplied as a proc, lambda or symbol which returns an enumerable. If the
# enumerable is a numerical range the test is performed with <tt>Range#cover?</tt>,
- # otherwise with <tt>include?</tt>.
+ # otherwise with <tt>include?</tt>. When using a proc or lambda the instance
+ # under validation is passed as an argument.
# * <tt>:within</tt> - A synonym(or alias) for <tt>:in</tt>
# * <tt>:message</tt> - Specifies a custom error message (default is: "is
# not included in the list").