# Models relationship summary / Entity relationship diagram

**URL:** <https://www.ruby-forum.com/t/models-relationship-summary-entity-relationship-diagram/108993>\
**Category:** Rails\
**Created:** [July 10, 2007, 2:04pm UTC](https://www.ruby-forum.com/t/models-relationship-summary-entity-relationship-diagram/108993 "2007-07-10T14:04:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![reynar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@reynar](https://www.ruby-forum.com/u/reynar)\
**Post date:** [July 10, 2007, 2:04pm UTC](https://www.ruby-forum.com/t/models-relationship-summary-entity-relationship-diagram/108993/1 "2007-07-10T14:04:25Z")

</div>

Hi,

Does anyone know of a tool or script that can parse the contents of  
the models folder and produce some sort of model relationship  
document, either a text summary or graphical representation?

Thanks, Andrew.

---

<div class="post-metadata">

**Author:** ![reynar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@reynar](https://www.ruby-forum.com/u/reynar)\
**Post date:** [July 10, 2007, 3:03pm UTC](https://www.ruby-forum.com/t/models-relationship-summary-entity-relationship-diagram/108993/2 "2007-07-10T15:03:33Z")

</div>

I’ve found a solution but wanted to post the answer just in case it is  
of interest to anyone else.

Check this link for a very concise looking script that outputs in  
Graphviz DOT format.

[http://www.hackdiary.com/archives/000093.html](http://www.hackdiary.com/archives/000093.html)

Andrew.

On 10 Jul, 13:03, Andrew E. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![reynar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@reynar](https://www.ruby-forum.com/u/reynar)\
**Post date:** [July 10, 2007, 3:38pm UTC](https://www.ruby-forum.com/t/models-relationship-summary-entity-relationship-diagram/108993/3 "2007-07-10T15:38:44Z")

</div>

Hi Andrew,

Andrew E. wrote:

> I’ve found a solution but wanted to post the answer just  
> in case it is of interest to anyone else.
> 
> Check this link for a very concise looking script that outputs  
> in Graphviz DOT format.
> 
> [http://www.hackdiary.com/archives/000093.html](http://www.hackdiary.com/archives/000093.html)

That looks like it could come in handy. Thanks for posting it.

Best regards,  
Bill

---

<div class="post-metadata">

**Author:** ![reynar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@reynar](https://www.ruby-forum.com/u/reynar)\
**Post date:** [July 10, 2007, 6:02pm UTC](https://www.ruby-forum.com/t/models-relationship-summary-entity-relationship-diagram/108993/4 "2007-07-10T18:02:12Z")

</div>

Hi Rob,

Rob B. wrote:

> I’ll throw my own gem into the pot here, I build on the  
> ideas that Matt has to produce model\_graph:
> 
> [http://rubyforge.org/projects/model-graph/](http://rubyforge.org/projects/model-graph/)

Cool! Thanks for sharing it.

Best regards,  
Bill

---

<div class="post-metadata">

**Author:** ![reynar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@reynar](https://www.ruby-forum.com/u/reynar)\
**Post date:** [July 10, 2007, 4:46pm UTC](https://www.ruby-forum.com/t/models-relationship-summary-entity-relationship-diagram/108993/5 "2007-07-10T16:46:54Z")

</div>

On Jul 10, 2007, at 8:03 AM, Andrew E. wrote:

> Hi,
> 
> Does anyone know of a tool or script that can parse the contents of  
> the models folder and produce some sort of model relationship  
> document, either a text summary or graphical representation?
> 
> Thanks, Andrew.

On Jul 10, 2007, at 9:37 AM, Bill W. wrote:

> > [http://www.hackdiary.com/archives/000093.html](http://www.hackdiary.com/archives/000093.html)
> 
> That looks like it could come in handy. Thanks for posting it.
> 
> Best regards,  
> Bill

I’ll throw my own gem into the pot here, I build on the ideas that  
Matt has to produce model\_graph:

[http://rubyforge.org/projects/model-graph/](http://rubyforge.org/projects/model-graph/)

IMHO, It does a much better job of depicting relationships. (And I  
_know_ that a legend would be helpful, it’s coming,… really!)

It also produces a DOT file that is best viewed with Graphviz, but  
can also be viewed with OmniGraffle (although the edge decorations  
aren’t nearly supported as well).

-Rob

Rob B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid
