Hi all! There are several softwares which read a database and shows the tables graphically on the screen (now I`m using Power Architect: http://www.sqlpower.ca/page/architect). Is there something which beyond to read the tables, can understand the relationship beetween it from app/models files? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi all! There are several softwares which read a database and shows the tables graphically on the screen (now I`m using Power Architect: http://www.sqlpower.ca/page/architect). Is there something which beyond to read the tables, can understand the relationship beetween it from app/models files? I say, has_many, belongs_to, etc... Ok, I could use Power Architect to read the tables and make the arrows by hand, but in a constant growing project, it is not a good way. Thank You Tom Lobato --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Tom, You read my mind, I just was about to post identical question... when I stumped upon some complicated models legacy models today. Is there something like that out there? H. On 21 Lis, 15:31, Tom Lobato <tomlob...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi all! > > There are several softwares which read a database and shows the > tables graphically on the screen (now I`m using Power Architect:http://www.sqlpower.ca/page/architect). Is there something which > beyond to read the tables, can understand the relationship beetween it > from app/models files? I say, has_many, belongs_to, etc... > > Ok, I could use Power Architect to read the tables and make the arrows > by hand, but in a constant growing project, it is not a good way. > > Thank You > Tom Lobato--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Oh, alright. I guess it''s way past time to get my updates to my model_graph code (http://rubyforge.org/projects/model-graph/) packaged up and posted. This reflects on the AR associations and builds a DOT file that can be visualized with, e.g., Graphviz. (From there you can export as PNG, PDF, etc.) -Rob On Nov 21, 2008, at 10:51 AM, Hubert Łępicki wrote:> > Hi Tom, > > You read my mind, I just was about to post identical question... when > I stumped upon some complicated models legacy models today. > > Is there something like that out there? > > H. > > On 21 Lis, 15:31, Tom Lobato <tomlob...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> Hi all! >> >> There are several softwares which read a database and shows the >> tables graphically on the screen (now I`m using Power Architect:http://www.sqlpower.ca/page/architect) >> . Is there something which >> beyond to read the tables, can understand the relationship beetween >> it >> from app/models files? I say, has_many, belongs_to, etc... >> >> Ok, I could use Power Architect to read the tables and make the >> arrows >> by hand, but in a constant growing project, it is not a good way. >> >> Thank You >> Tom Lobato > >Rob Biedenharn http://agileconsultingllc.com Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org +1 513-295-4739 Skype: rob.biedenharn --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks Rob! That is great script, I didn''t use Graphviz before so this was more trouble than installing yor gem ;). However, not sure if it''s my fault - or library works like that, generated graph was hard to read and analyze, it also didn''t include model attributes. Googling for "ruby graphviz" was more successful: http://visualizemodels.rubyforge.org/ Is really nice plugin, generates cool graphs. I just had to make little fix for Rails 2.2 to work, but it''s easy. Best, H. On 21 Lis, 17:19, Rob Biedenharn <R...-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org> wrote:> Oh, alright. I guess it''s way past time to get my updates to my > model_graph code (http://rubyforge.org/projects/model-graph/) packaged > up and posted. This reflects on the AR associations and builds a DOT > file that can be visualized with, e.g., Graphviz. (From there you can > export as PNG, PDF, etc.) > > -Rob > > On Nov 21, 2008, at 10:51 AM, Hubert Łępicki wrote: > > > > > > > Hi Tom, > > > You read my mind, I just was about to post identical question... when > > I stumped upon some complicated models legacy models today. > > > Is there something like that out there? > > > H. > > > On 21 Lis, 15:31, Tom Lobato <tomlob...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> Hi all! > > >> There are several softwares which read a database and shows the > >> tables graphically on the screen (now I`m using Power Architect:http://www.sqlpower.ca/page/architect) > >> . Is there something which > >> beyond to read the tables, can understand the relationship beetween > >> it > >> from app/models files? I say, has_many, belongs_to, etc... > > >> Ok, I could use Power Architect to read the tables and make the > >> arrows > >> by hand, but in a constant growing project, it is not a good way. > > >> Thank You > >> Tom Lobato > > Rob Biedenharn http://agileconsultingllc.com > R...-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org > +1 513-295-4739 > Skype: rob.biedenharn--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
model_graph doesn''t do the attributes on purpose.  My need was to  
avoid redrawing the associations at a time on a particular project  
where they were driving me a bit crazy.  The use of decorated edges to  
denote the kind of association is one thing that I didn''t find  
elsewhere.
If you download the test file (or find it in the gem directory, I think)
   http://model-graph.rubyforge.org/svn/model_graph_test.dot
and open it with Graphviz, you see the edge types that mean:
         class A < ActiveRecord::Base  # :nodoc:
           has_many :bs
           has_one :c
         end
         class B < ActiveRecord::Base  # :nodoc:
           belongs_to :a
         end
         class C < ActiveRecord::Base  # :nodoc:
           belongs_to :a
         end
         class One < ActiveRecord::Base  # :nodoc:
           has_and_belongs_to_many :twos
         end
         class Two < ActiveRecord::Base  # :nodoc:
           has_and_belongs_to_many :ones
         end
         class Alpha < ActiveRecord::Base  # :nodoc:
           has_many :betas
           has_many :gammas, :through => :betas
         end
         class Beta < ActiveRecord::Base  # :nodoc:
           belongs_to :alpha
           belongs_to :gamma
         end
         class Gamma < ActiveRecord::Base  # :nodoc:
           has_many :betas
           has_many :alphas, :through => :betas
         end
         class Selfish < ActiveRecord::Base  # :nodoc:
           has_many :selfishes, :foreign_key => :solo_id
         end
So a brief legend (in ASCII) would be:
  -|   belongs_to
  -|o  has_one
  -o<  has_many
       dotted edge => has_many :through
  -o<<>>o-  has_and_belongs_to_many
     (where <> is a small, unlabeled, diamond-shaped node)
Please do forward your fix for Rails 2.2!
Glad it helps a bit,
-Rob
On Nov 21, 2008, at 12:12 PM, Hubert Łępicki wrote:
>
> Thanks Rob!
>
> That is great script, I didn''t use Graphviz before so this was
more
> trouble than installing yor gem ;).
>
> However, not sure if it''s my fault - or library works like that,
> generated graph was hard to read and analyze, it also didn''t
include
> model attributes.
>
> Googling for "ruby graphviz" was more successful:
> http://visualizemodels.rubyforge.org/
>
> Is really nice plugin, generates cool graphs. I just had to make
> little fix for Rails 2.2 to work, but it''s easy.
>
> Best,
> H.
>
> On 21 Lis, 17:19, Rob Biedenharn
<R...-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org> wrote:
>> Oh, alright.  I guess it''s way past time to get my updates to
my
>> model_graph code (http://rubyforge.org/projects/model-graph/)  
>> packaged
>> up and posted.  This reflects on the AR associations and builds a DOT
>> file that can be visualized with, e.g., Graphviz.  (From there you  
>> can
>> export as PNG, PDF, etc.)
>>
>> -Rob
>>
>> On Nov 21, 2008, at 10:51 AM, Hubert Łępicki wrote:
>>
>>> Hi Tom,
>>
>>> You read my mind, I just was about to post identical question...  
>>> when
>>> I stumped upon some complicated models legacy models today.
>>
>>> Is there something like that out there?
>>
>>> H.
>>
>>> On 21 Lis, 15:31, Tom Lobato
<tomlob...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>>>  Hi all!
>>
>>>>  There are several softwares which read a database and shows
the
>>>> tables graphically on the screen (now I`m using Power
Architect:http://www.sqlpower.ca/page/architect)
>>>> . Is there something which
>>>> beyond to read the tables, can understand the relationship
beetween
>>>> it
>>>> from app/models files? I say, has_many, belongs_to, etc...
>>
>>>> Ok, I could use Power Architect to read the tables and make the
>>>> arrows
>>>> by hand, but in a constant growing project, it is not a good
way.
>>
>>>> Thank You
>>>> Tom Lobato
Rob Biedenharn		http://agileconsultingllc.com
Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
You can also try using RrailRoad (http://railroad.rubyforge.org/). I find it pretty simple and neat. Note: It does not pick belongs_to relationships and uses the has_many from the other direction for figuring out relationships. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---