# Multiple calls of validate() method in composed model by ActiveRecord, why?

**URL:** <https://www.ruby-forum.com/t/multiple-calls-of-validate-method-in-composed-model-by-activerecord-why/189405>\
**Category:** Rails\
**Created:** [May 31, 2010, 12:51pm UTC](https://www.ruby-forum.com/t/multiple-calls-of-validate-method-in-composed-model-by-activerecord-why/189405 "2010-05-31T12:51:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![msmsms](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/34f0e0/32.png) [@msmsms](https://www.ruby-forum.com/u/msmsms)\
**Post date:** [May 31, 2010, 12:51pm UTC](https://www.ruby-forum.com/t/multiple-calls-of-validate-method-in-composed-model-by-activerecord-why/189405/1 "2010-05-31T12:51:41Z")

</div>

Hi,

thank you for reading my post. When I went trough my logs last time, I  
noticed that ActiveRecord calls the validate() method of one of my  
models multiple times. The concerned model acts like a linked list (no  
plug-in) and references itself. The validate() method is not only  
called twice, but three or four times depending on the position of the  
model instance in the list.

What’s the reason for this and how can I get rid of this?

Thank you very much in advance,  
ms

---

<div class="post-metadata">

**Author:** ![msmsms](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/34f0e0/32.png) [@msmsms](https://www.ruby-forum.com/u/msmsms)\
**Post date:** [May 31, 2010, 5:44pm UTC](https://www.ruby-forum.com/t/multiple-calls-of-validate-method-in-composed-model-by-activerecord-why/189405/2 "2010-05-31T17:44:22Z")

</div>

On May 31, 11:50 am, ms [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi,
> 
> thank you for reading my post. When I went trough my logs last time, I  
> noticed that ActiveRecord calls the validate() method of one of my  
> models multiple times. The concerned model acts like a linked list (no  
> plug-in) and references itself. The validate() method is not only  
> called twice, but three or four times depending on the position of the  
> model instance in the list.
> 
> What’s the reason for this and how can I get rid of this?

What does your code look like?

Fred
