diff options
Diffstat (limited to 'activemodel/lib/active_model/validations/confirmation.rb')
-rw-r--r-- | activemodel/lib/active_model/validations/confirmation.rb | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/activemodel/lib/active_model/validations/confirmation.rb b/activemodel/lib/active_model/validations/confirmation.rb index b6cf82fb19..d41f401999 100644 --- a/activemodel/lib/active_model/validations/confirmation.rb +++ b/activemodel/lib/active_model/validations/confirmation.rb @@ -25,7 +25,7 @@ module ActiveModel # class Person < ActiveRecord::Base # validates_confirmation_of :user_name, :password # validates_confirmation_of :email_address, - # :message => "should match confirmation" + # message: 'should match confirmation' # end # # View: @@ -38,10 +38,10 @@ module ActiveModel # attribute. # # NOTE: This check is performed only if +password_confirmation+ is not - # +nil+. To require confirmation, make sure - # to add a presence check for the confirmation attribute: + # +nil+. To require confirmation, make sure to add a presence check for + # the confirmation attribute: # - # validates_presence_of :password_confirmation, :if => :password_changed? + # validates_presence_of :password_confirmation, if: :password_changed? # # Configuration options: # * <tt>:message</tt> - A custom error message (default is: "doesn't match @@ -50,15 +50,16 @@ module ActiveModel # validation contexts by default (+nil+), other options are <tt>:create</tt> # and <tt>:update</tt>. # * <tt>:if</tt> - Specifies a method, proc or string to call to determine - # if the validation should occur (e.g. <tt>:if => :allow_validation</tt>, - # or <tt>:if => Proc.new { |user| user.signup_step > 2 }</tt>). The - # method, proc or string should return or evaluate to a true or false - # value. + # if the validation should occur (e.g. <tt>if: :allow_validation</tt>, + # or <tt>if: Proc.new { |user| user.signup_step > 2 }</tt>). The + # method, proc or string should return or evaluate to a +true+ or + # +false+ value. # * <tt>:unless</tt> - Specifies a method, proc or string to call to # determine if the validation should not occur (e.g. - # <tt>:unless => :skip_validation</tt>, or - # <tt>:unless => Proc.new { |user| user.signup_step <= 2 }</tt>). The - # method, proc or string should return or evaluate to a true or false value. + # <tt>unless: :skip_validation</tt>, or + # <tt>unless: Proc.new { |user| user.signup_step <= 2 }</tt>). The + # method, proc or string should return or evaluate to a +true+ or + # +false+ value. # * <tt>:strict</tt> - Specifies whether validation should be strict. # See <tt>ActiveModel::Validation#validates!</tt> for more information. def validates_confirmation_of(*attr_names) |