从 Rails 代码创建 ERD 类型图
我开始学习 Ruby on Rails,并查看其他人的代码。 有没有办法采用现有的代码库并创建对象关系图或实体关系图(ERD)?
我知道 Visio 可以在给定数据库的情况下执行某些操作,但我希望生成类和对象的图表。
I'm beginning to learn Ruby on Rails, and looking at other peoples code. Is there any way to take an exisiting codebase and create object relationship diagrams or Entity relationship diagrams (ERD's) ?
I know Visio can do some things given a database, but I was hoping to produce diagrams of classes and objects.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
另外Rails ERD也不错。 它比 Railroad 简单一点,但它仍然是一个伟大的项目。
Also Rails ERD is not bad. It is a bit simpler than Railroad but it is still a great project.
您可能想查看铁路。 它获取您的 Rails 项目并将其可视化。 它可以根据你的模型(基于 has_many、has_and_belongs_to_many 等)、控制器(基于继承层次结构)和状态机图创建图表,这是我从未使用过的。
但它非常酷并且做了它应该做的事情。 它可能不具备 Visio 的全部功能,但它是一个非常好的解决方案。
You may want to check out Railroad. It takes your Rails project and visualizes it. It can create diagrams based off of your models (based off of has_many, has_and_belongs_to_many, etc), controllers (based on inheritance hierarchy) and state machine diagrams, which I have never used.
But it is pretty cool and does what it is supposed to. It may not have all the flair that Visio has but it is a darn good solution.
一些 IDE 有这个功能,如果我没记错的话 RubyMine 有。
Some IDE's have this feature, if I remember rightly RubyMine does.
Rails ERD 拥有优秀的文档和图库:
http://rails-erd.rubyforge.org/gallery.html
Rails ERD has excellent documentation and gallery:
http://rails-erd.rubyforge.org/gallery.html