TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Visualizing Rails Schemas with the RailRoady Gem

36 点作者 ar4420大约 11 年前

9 条评论

phillmv大约 11 年前
This is a side tangent but seeing graphviz being used here reminded me of this total boss ruby patch: <a href="http://cirw.in/blog/find-references" rel="nofollow">http:&#x2F;&#x2F;cirw.in&#x2F;blog&#x2F;find-references</a><p>I had spent a week slowly isolating this brutal memory leak until being able to see the whole ObjectSpace illuminated my problem.
Bjoern大约 11 年前
DataMapper has this as dm-visualizer as well in case you use that over AR in rails. <a href="https://github.com/postmodern/dm-visualizer" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;postmodern&#x2F;dm-visualizer</a>
jabagonuts大约 11 年前
I just yesterday found the rails-erd gem to accomplish the same task. <a href="https://github.com/voormedia/rails-erd" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;voormedia&#x2F;rails-erd</a>
mcmire大约 11 年前
The problem I have with these tools is that the diagram it produces is really not that great. I guess it tells you what models you have, the columns they have, and whether a model is tied to another one... but not much else.<p>Here&#x27;s the thing: I already know how many models I have (I just look in app&#x2F;models) and which columns back them (I just look in db&#x2F;schema).<p>The thing I often want that 1) ActiveRecord doesn&#x27;t give me and 2) I haven&#x27;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&#x27;ve seen arrows: B points to A, with the words &quot;has many&quot; written next to it. The thing is, if I have 30 models in my app, I&#x27;m not going to be able to read this at a glance. Words are too small. Diagrams are meant to be rough pictures.<p>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&#x27;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.
TallboyOne大约 11 年前
I prefer rails-ERD. annotate_models is also great.
评论 #7385750 未加载
sergiotapia大约 11 年前
RubyMine has this features built in and provides nice tools to manipulate the end diagram.
arikrak大约 11 年前
Rubymine comes with such a feature built-in. However, I found that my model diagram was too complicated to really be useful.
thejosh大约 11 年前
If you use MySQL, planning with MySQL Workbench provides similar results to what was shown (table to table relations).
acconrad大约 11 年前
DbWrench for Mac along with PgAdmin is another good alternative for doing this with a Postgres database.
评论 #7386566 未加载