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

Added forgotten :message option to ActiveModel validates documentation

This commit is contained in:
Anatoly Makarevich 2012-09-07 14:56:23 +04:00
parent bf15169c48
commit fce0d088a5

View file

@ -94,10 +94,10 @@ module ActiveModel
# validates :token, uniqueness: true, strict: TokenGenerationException
#
#
# Finally, the options +:if+, +:unless+, +:on+, +:allow_blank+, +:allow_nil+
# and +:strict+ can be given to one specific validator, as a hash:
# Finally, the options +:if+, +:unless+, +:on+, +:allow_blank+, +:allow_nil+, +:strict+
# and +:message+ can be given to one specific validator, as a hash:
#
# validates :password, presence: { if: :password_required? }, confirmation: true
# validates :password, presence: { if: :password_required?, message: 'is forgotten.' }, confirmation: true
def validates(*attributes)
defaults = attributes.extract_options!.dup
validations = defaults.slice!(*_validates_default_keys)