By James Dabbs, Ruby Instructor
I recently had a very interesting conversation with Chris Hoffman atDCRUG, talking about how to explore the object graph of a highly complex Rails app. I’ve been mulling over some of his ideas and found myself with a few hours to kill on a flight from Austin, so I dug in and did the following rather enjoyable bit of spelunking.
Here’s what I want –
- A view of the ancestry lattice of each class
- A view of the
(has|belongs_to)_(many|one)relationships of reach class
- A (summary) view of the message flow between instances of each class
preferably with some option for filtering down to only classes “of interest” (i.e. defined in this particular app, or not defined in Rails or something).
Ultimately, I’d love to produce a gem from this which mounts as a Rails engine exposing a rich D3 visualization of all those graphs. But it’s a short flight, so let’s start by proving the concept and make sure we have access to the data we need.