# Partial updates and validations

**URL:** <https://www.ruby-forum.com/t/partial-updates-and-validations/139769>\
**Category:** Rails\
**Created:** [June 6, 2008, 9:05pm UTC](https://www.ruby-forum.com/t/partial-updates-and-validations/139769 "2008-06-06T21:05:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Virginian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/bc8723/32.png) [@Virginian](https://www.ruby-forum.com/u/Virginian)\
**Post date:** [June 6, 2008, 9:05pm UTC](https://www.ruby-forum.com/t/partial-updates-and-validations/139769/1 "2008-06-06T21:05:39Z")

</div>

Given a very wide table from a legacy database, I am going through a  
form wizard updating specific attributes on different pages.

Is there a way to check to run validates\_presence\_of only on specific  
attributes that have changed?

I was trying something like:

validates\_presence\_of :p1\_new\_first\_name, :if  
=\> :p1\_new\_first\_name\_changed?

validates\_presence\_of :p1\_first\_name, :if =\> :p1\_first\_name\_changed?

And it almost works, but the flaw is obvious. If the attribute is left  
blank, it wont be changed even if it goes from nil to a “” . Is there  
any way around this?
