1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fixed documentation #538

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@503 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson 2005-01-25 11:20:42 +00:00
parent 2f11b7cfee
commit 256b594a03

View file

@ -254,7 +254,7 @@ module ActiveRecord
# Configuration options:
# * <tt>in</tt> - An enumerable object of available items
# * <tt>message</tt> - Specifieds a customer error message (default is: "is not included in the list")
# * <tt>allows_nil</tt> - If set to true, skips this validation if the attribute is null (default is: false)
# * <tt>allow_nil</tt> - If set to true, skips this validation if the attribute is null (default is: false)
def validates_inclusion_of(*attr_names)
configuration = { :message => ActiveRecord::Errors.default_error_messages[:inclusion], :on => :save }
configuration.update(attr_names.pop) if attr_names.last.is_a?(Hash)