# How to validations while updating a model?

**URL:** <https://www.ruby-forum.com/t/how-to-validations-while-updating-a-model/144387>\
**Category:** Rails\
**Created:** [July 29, 2008, 9:32am UTC](https://www.ruby-forum.com/t/how-to-validations-while-updating-a-model/144387 "2008-07-29T09:32:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![martin\_mercy2001](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d2c977/32.png) [@martin\_mercy2001](https://www.ruby-forum.com/u/martin_mercy2001)\
**Post date:** [July 29, 2008, 9:32am UTC](https://www.ruby-forum.com/t/how-to-validations-while-updating-a-model/144387/1 "2008-07-29T09:32:03Z")

</div>

Dear all,

How to do validations while updating a model using method  
update\_attributes()?

Thanks in advance.

Regards,  
Jose Martin

---

<div class="post-metadata">

**Author:** ![martin\_mercy2001](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d2c977/32.png) [@martin\_mercy2001](https://www.ruby-forum.com/u/martin_mercy2001)\
**Post date:** [July 29, 2008, 9:41am UTC](https://www.ruby-forum.com/t/how-to-validations-while-updating-a-model/144387/2 "2008-07-29T09:41:03Z")

</div>

question your sense make does not.

Validations are ran whenever you update or save a method, unless  
you’ve specified otherwise.

---

<div class="post-metadata">

**Author:** ![martin\_mercy2001](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d2c977/32.png) [@martin\_mercy2001](https://www.ruby-forum.com/u/martin_mercy2001)\
**Post date:** [July 29, 2008, 4:33pm UTC](https://www.ruby-forum.com/t/how-to-validations-while-updating-a-model/144387/3 "2008-07-29T16:33:36Z")

</div>

dare ruby wrote:

> Dear all,
> 
> How to do validations while updating a model using method  
> update\_attributes()?
> 
> Thanks in advance.
> 
> Regards,  
> Jose Martin

At the time updating or saving any database related operation the  
validation will work if not working means see in your rhtml file whether  
the your used model objects properly or not if it proper it should  
work…
