Forum: Ruby on Rails Dumb polymorphic association question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
4436333655e947f1a0da99a251abe0c6?d=identicon&s=25 Matthew Denner (Guest)
on 2006-05-05 14:26
(Received via mailing list)
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
9f0f89bbd9e1ecfbaab6584e429b7a2f?d=identicon&s=25 Josh Susser (jsusser)
on 2006-05-05 20:37
Matthew Denner 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 Susser
http://blog.hasmanythrough.com
4436333655e947f1a0da99a251abe0c6?d=identicon&s=25 Matthew Denner (Guest)
on 2006-05-06 13:28
(Received via mailing list)
On 5/5/06, Josh Susser <josh@hasmanythrough.com> 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
This topic is locked and can not be replied to.