# Order of validation execution

**URL:** <https://www.ruby-forum.com/t/order-of-validation-execution/195975>\
**Category:** Rails\
**Created:** [October 4, 2010, 3:18pm UTC](https://www.ruby-forum.com/t/order-of-validation-execution/195975 "2010-10-04T15:18:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_Greif](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e95f7d/32.png) [@Alex\_Greif](https://www.ruby-forum.com/u/Alex_Greif)\
**Post date:** [October 4, 2010, 3:18pm UTC](https://www.ruby-forum.com/t/order-of-validation-execution/195975/1 "2010-10-04T15:18:13Z")

</div>

in which order are the validations executed that apply to the same  
attribute.  
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?

thanks,  
ALex.
