# Self-referential? model help

**URL:** <https://www.ruby-forum.com/t/self-referential-model-help/107509>\
**Category:** Rails\
**Created:** [June 22, 2007, 12:18pm UTC](https://www.ruby-forum.com/t/self-referential-model-help/107509 "2007-06-22T12:18:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tate\_H](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/8edcca/32.png) [@Tate\_H](https://www.ruby-forum.com/u/Tate_H)\
**Post date:** [June 22, 2007, 12:18pm UTC](https://www.ruby-forum.com/t/self-referential-model-help/107509/1 "2007-06-22T12:18:04Z")

</div>

Hi: Any suggestions for modeling this?

Event A may have 0 or many child events and may have 0 or many parent  
events.

TIA,

-tate

---

<div class="post-metadata">

**Author:** ![Tate\_H](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/8edcca/32.png) [@Tate\_H](https://www.ruby-forum.com/u/Tate_H)\
**Post date:** [June 22, 2007, 12:21pm UTC](https://www.ruby-forum.com/t/self-referential-model-help/107509/2 "2007-06-22T12:21:05Z")

</div>

On 6/22/07, Tate H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> TIA,
> 
> -tate

Here’s one way  
[http://blog.hasmanythrough.com/2006/4/21/self-referential-through](http://blog.hasmanythrough.com/2006/4/21/self-referential-through)

---

<div class="post-metadata">

**Author:** ![Tate\_H](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/8edcca/32.png) [@Tate\_H](https://www.ruby-forum.com/u/Tate_H)\
**Post date:** [June 22, 2007, 12:46pm UTC](https://www.ruby-forum.com/t/self-referential-model-help/107509/3 "2007-06-22T12:46:09Z")

</div>

Tate H. wrote:

> Hi: Any suggestions for modeling this?
> 
> Event A may have 0 or many child events and may have 0 or many parent  
> events.

Perhaps [http://blog.tammersaleh.com/pages/acts\_as\_graph](http://blog.tammersaleh.com/pages/acts_as_graph) can be of  
assistance. I haven’t tried it myself, so I don’t know how good it is.

–  
Cheers,

- Jacob A.
