Order of validation execution

in which order are the validations executed that apply to the same
Say I have this code in my model:

validates_presence_of :password
validates_confirmation_of :password, :message => “must match confirm
password”, :if => Proc.new { |u| !u.password.blank? }

  1. Are the validations executed in the order I coed them in the
    model’s file?
    Or is it undetermined, and I should not rely on any order?

  2. Is this behaviour the same in 2.x and 3.x?


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs