Forum: Ruby on Rails Modelist gem now helps find path between ActiveRecord models and search by name/table/assoc/column

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
8838005371ab9c0b1d40f0504bf8832a?d=identicon&s=25 Gary Weaver (garysweaver)
on 2013-06-28 15:58
(Received via mailing list)
We have a complex legacy schema with a lot of tables and models, and I
can't keep all of the paths between tables in my head, so just wrote
something that could help find the path between any two models just by
entering their model names like:

bundle exec modelist paths my_model_1 my_model_2

which results in (greatly simplified because a full actual response is
much, much longer):

checking for path from foobar to barfoo...

Paths from foobar to barfoo (2): -> foo.barfoos -> barfoo

foobar.barfoo -> barfoo

(shortest path last)


bundle exec modelist search partial_search_string

results in:

  Foo (table: foos)
  Foobar (table: foobars)
  Bar (table: bars), association: foo (macro: belongs_to, options: {})
  Loo (table: loos), association: f_users (macro: has_one, options:

Check it out and please report issues in github and do PR's for fixes:

It is a little messy at the moment, but it seems to be working ok for
unless I'm missing something.

This topic is locked and can not be replied to.