# Associations not found - breaks randomly

**URL:** <https://www.ruby-forum.com/t/associations-not-found-breaks-randomly/107770>\
**Category:** Rails\
**Created:** [June 26, 2007, 2:54am UTC](https://www.ruby-forum.com/t/associations-not-found-breaks-randomly/107770 "2007-06-26T02:54:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elmar\_Schraml](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/858c86/32.png) [@Elmar\_Schraml](https://www.ruby-forum.com/u/Elmar_Schraml)\
**Post date:** [June 26, 2007, 2:54am UTC](https://www.ruby-forum.com/t/associations-not-found-breaks-randomly/107770/1 "2007-06-26T02:54:06Z")

</div>

Hi,

I’ve set up an association for a 1:n-relationship, totally standard  
stuff.  
However, I sometimes get an error “Association XY not found, maybe you  
misspelled it?” when loading a view that makes use of the association  
(only something simple like \<%= cur\_book.author. (contrived example, but I really only do the simplest standard  
stuff).

The trouble is, I get this error maybe 20% of the time, but it happens  
for all associations, no matter which models are involved. Normally it  
works, so I don’t think it has anything to do with settting up the  
association, table names etc. But it still happens often enough that I  
can’t use associations, and have to resort to doing searches for the  
associated objects in the view, which is really ugly.

Has anybody else witnessed this kind of thing (I did a search, but  
couldn’t find anything about it).

Thanks,  
Elmar

---

<div class="post-metadata">

**Author:** ![Elmar\_Schraml](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/858c86/32.png) [@Elmar\_Schraml](https://www.ruby-forum.com/u/Elmar_Schraml)\
**Post date:** [June 26, 2007, 2:58am UTC](https://www.ruby-forum.com/t/associations-not-found-breaks-randomly/107770/2 "2007-06-26T02:58:07Z")

</div>

On 25-Jun-07, at 11:50 AM, Elmar Schraml wrote:

> Thanks,  
> Elmar

Elmar, I suggest you tail -f your development log - you may have a  
mysql (or other db) connection error - or some entirely different  
exception.

If you have done this, then we can help out more easily with more  
symptoms - including mvc/controller/view code. But since this bug  
seems random is smells like infrastructure.

Cheers,  
Jodi
