# Dumb polymorphic association question

**URL:** <https://www.ruby-forum.com/t/dumb-polymorphic-association-question/59688>\
**Category:** Rails\
**Created:** [May 5, 2006, 2:26pm UTC](https://www.ruby-forum.com/t/dumb-polymorphic-association-question/59688 "2006-05-05T14:26:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthew\_d](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/48db29/32.png) [@matthew\_d](https://www.ruby-forum.com/u/matthew_d)\
**Post date:** [May 5, 2006, 2:26pm UTC](https://www.ruby-forum.com/t/dumb-polymorphic-association-question/59688/1 "2006-05-05T14:26:48Z")

</div>

Hi,

Why is it that polymorphic associations only work with the :has\_many  
and :belongs\_to relationships? Why can’t it be a :has\_one?

Matt

---

<div class="post-metadata">

**Author:** ![matthew\_d](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/48db29/32.png) [@matthew\_d](https://www.ruby-forum.com/u/matthew_d)\
**Post date:** [May 5, 2006, 8:37pm UTC](https://www.ruby-forum.com/t/dumb-polymorphic-association-question/59688/2 "2006-05-05T20:37:18Z")

</div>

Matthew D. wrote:

> Why is it that polymorphic associations only work with the :has\_many  
> and :belongs\_to relationships? Why can’t it be a :has\_one?

The answer to this sort of question is always one of three things.  
Either it’s not useful, it’s not feasible, or someone hasn’t taken the  
time to make it work yet. In this case I think it’s the last one.  
Remember that Rails features almost always are developed in response to  
needs for real-world development - people don’t just sit around  
implementing features in the hopes that someday they will be useful.

I hope that didn’t sound snarky. Just trying to answer your question.

–  
Josh S.  
[http://blog.hasmanythrough.com](http://blog.hasmanythrough.com)

---

<div class="post-metadata">

**Author:** ![matthew\_d](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/48db29/32.png) [@matthew\_d](https://www.ruby-forum.com/u/matthew_d)\
**Post date:** [May 6, 2006, 1:28pm UTC](https://www.ruby-forum.com/t/dumb-polymorphic-association-question/59688/3 "2006-05-06T13:28:50Z")

</div>

On 5/5/06, Josh S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I hope that didn’t sound snarky. Just trying to answer your question.

No, absolutely not snarky (great word!), I was concerned I’d missed  
something! Maybe I’ll have a look at how the polymorphic stuff hangs  
together to see if I can get anywhere with doing it.

Matt
