# Acessing new field values in validate\_on\_update

**URL:** <https://www.ruby-forum.com/t/acessing-new-field-values-in-validate-on-update/106355>\
**Category:** Rails\
**Created:** [June 8, 2007, 10:28pm UTC](https://www.ruby-forum.com/t/acessing-new-field-values-in-validate-on-update/106355 "2007-06-08T22:28:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3bc359/32.png) [@jon](https://www.ruby-forum.com/u/jon)\
**Post date:** [June 8, 2007, 10:28pm UTC](https://www.ruby-forum.com/t/acessing-new-field-values-in-validate-on-update/106355/1 "2007-06-08T22:28:20Z")

</div>

Hello,

How to access to old field values in validate\_on\_update method? I need  
to see if there is changed field’s value and if it is so, rise an  
error.

Thank you!

---

<div class="post-metadata">

**Author:** ![jon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3bc359/32.png) [@jon](https://www.ruby-forum.com/u/jon)\
**Post date:** [June 11, 2007, 5:56pm UTC](https://www.ruby-forum.com/t/acessing-new-field-values-in-validate-on-update/106355/2 "2007-06-11T17:56:59Z")

</div>

I haven’t tested this but you could try using Model.find() to get the  
version of the object from the database which will as yet be unmodified  
by the save. Then compare the fields with the (unsaved) version to see  
if changes have been made.

Try it, if it doesnt work I’ll suggest something else.

steve
