# Can't eagerly load a polymorphic association defined in an STI parent class?

**URL:** <https://www.ruby-forum.com/t/cant-eagerly-load-a-polymorphic-association-defined-in-an-sti-parent-class/188216>\
**Category:** Rails\
**Created:** [May 7, 2010, 7:58pm UTC](https://www.ruby-forum.com/t/cant-eagerly-load-a-polymorphic-association-defined-in-an-sti-parent-class/188216 "2010-05-07T19:58:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![murfhy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d26b3c/32.png) [@murfhy](https://www.ruby-forum.com/u/murfhy)\
**Post date:** [May 7, 2010, 7:58pm UTC](https://www.ruby-forum.com/t/cant-eagerly-load-a-polymorphic-association-defined-in-an-sti-parent-class/188216/1 "2010-05-07T19:58:02Z")

</div>

If I define an association (in my case a polymorphic one) in an STI  
parent class, and try to eagerly load it in a subclass, I get the  
following error:

ActiveRecord::ConfigurationError: Association name ‘myassoc’ was not  
found; perhaps you misspelled it?

If I redefine the same association again in the STI subclass, it  
works.

Is this a bug or what?

---

<div class="post-metadata">

**Author:** ![murfhy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d26b3c/32.png) [@murfhy](https://www.ruby-forum.com/u/murfhy)\
**Post date:** [May 7, 2010, 8:02pm UTC](https://www.ruby-forum.com/t/cant-eagerly-load-a-polymorphic-association-defined-in-an-sti-parent-class/188216/2 "2010-05-07T20:02:43Z")

</div>

On 7 May 2010 18:56, Tony A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Is this a bug or what?

Probably.

If you post a pared-down set of model code and how you’re trying to  
load it; then we can see if we can help you spot it.
