# General iplementation question Do I need polymorphic here

**URL:** <https://www.ruby-forum.com/t/general-iplementation-question-do-i-need-polymorphic-here/160039>\
**Category:** Rails\
**Created:** [February 11, 2009, 8:20am UTC](https://www.ruby-forum.com/t/general-iplementation-question-do-i-need-polymorphic-here/160039 "2009-02-11T08:20:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [February 11, 2009, 8:20am UTC](https://www.ruby-forum.com/t/general-iplementation-question-do-i-need-polymorphic-here/160039/1 "2009-02-11T08:20:00Z")

</div>

Hi  
I have to create a request for an organization and also to create a  
request for many Contacts…Now what I do is treating all these in a  
single table say request and it has all the fields like  
organization\_name, contact\_name etc Here company\_name is at atime one  
for a request but contacts are more than one say primary\_contacts,other  
contacts etc…what my question I tried here a polymorphic relation here  
like  
class request \<ActiveRecord  
belongs\_to :request,:ploymorphic=\>true  
end  
class Organization \<ActiveRecord  
has\_one :request,:as=\>:request  
end  
class Contact \<ActiveRecord  
has\_one :request,:as=\>:request  
end

```
But I think this not correct since it makes sense like

```

orgnization.request and  
contact.requests

```
      But what I need is the reverse way..(Am I right?)..Please help

```

to properly arrange this

Thanks in advance  
Sijo

---

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [February 11, 2009, 1:01pm UTC](https://www.ruby-forum.com/t/general-iplementation-question-do-i-need-polymorphic-here/160039/2 "2009-02-11T13:01:08Z")

</div>

I shal explain more. I have say three tabs like  
Organization PrimaryContact OtherContacts

And each tab contains there own information and at bottom a common save  
button there.When clicking on that what happens is a new Request is  
created and it has to associate and save with the above data…But here I  
dont know how to form the tables and the relations and also in REST way  
Please help
