Permalink
Browse files

doc proc/lambda arg on inclusion validation. Closes #13689. [ci skip]

  • Loading branch information...
1 parent 3a521bc commit 8c0d5e0d1cfcec4ae6618e4ae8286421ff0f92fa @senny senny committed Jan 13, 2014
Showing with 2 additions and 1 deletion.
  1. +2 −1 activemodel/lib/active_model/validations/inclusion.rb
View
3 activemodel/lib/active_model/validations/inclusion.rb
@@ -29,7 +29,8 @@ module HelperMethods
# * <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").

0 comments on commit 8c0d5e0

Please sign in to comment.