Earlier quoted context omitted.
Instead of annotate models, I have a function in my .irbrc/.pryrc that will print out the columns for me when I'm in a rails console (I usually have one open almost all of the time). I prefer this to cluttering my model files. [6] pry(main)> c Account Columns for 'accounts' id :integer created_at :datetime updated_at :datetime address :string city :string state :string zip :string phone_number :string last_ip :string…
Do you keep the rails console running constantly? It seems more inconvenient to start and stop the rails console than navigate files for your schema, which is also searchable by virtue of it being written down.
Visualizing Rails Schemas with the RailRoady Gem
11–14 of 14 posts
Re: Visualizing Rails Schemas with the RailRoady Gem
#12I had spent a week slowly isolating this brutal memory leak until being able to see the whole ObjectSpace illuminated my problem.
Re: Visualizing Rails Schemas with the RailRoady Gem
#13DbWrench for Mac along with PgAdmin is another good alternative for doing this with a Postgres database.
http://www.pgmodeler.com.br/ https://github.com/pgmodeler/pgmodeler
Re: Visualizing Rails Schemas with the RailRoady Gem
#14Here's the thing: I already know how many models I have (I just look in app/models) and which columns back them (I just look in db/schema).
The thing I often want that 1) ActiveRecord doesn't give me and 2) I haven't seen in any tool yet is a diagram of the relationships. So I have two models, A and B, and A has many B. How do you diagram that? Typically I've seen arrows: B points to A, with the words "has many" written next to it. The thing is, if I have 30 models in my app, I'm not going to be able to read this at a glance. Words are too small. Diagrams are meant to be rough pictures.
The way I visualize this in my head and consequently diagram this on a whiteboard is, multiple instances of B point back to A. It's easy. If you have a has_one instead, then only one B points back to A. Makes sense right? No one does this. I often wonder why.