Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added forgotten :message option to ActiveModel validates documentation

  • Loading branch information...
commit fce0d088a591d7254fcda8e45683a43eff508957 1 parent bf15169
@makaroni4 makaroni4 authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 activemodel/lib/active_model/validations/validates.rb
View
6 activemodel/lib/active_model/validations/validates.rb
@@ -94,10 +94,10 @@ module ClassMethods
# 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)
Please sign in to comment.
Something went wrong with that request. Please try again.