23
23

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

railroadyでrailsのモデルを可視化する

23
Last updated at Posted at 2013-07-24

概要

railroadyとgraphvisを利用して,railsのモデルからデータベーススキーマの状態とモデルに設定したリレーションを可視化することができます.

インストール

graphvisのインストールにはbrewを利用します. 後でいろいろ試せるようにライブラリも一緒にインストールします.

brew install graphviz  --with-gts

railroadyのインストール

gem i railroady

使い方

railsのプロジェクトディレクトリ内でコマンドを実行.

# 基本的な使い方
railroady -M | circo -Tpng > rody.png
railroady -M | neato -Tpng > rody.png

# モデルに解析を加える
railroady -M | tred | circo -Tpng > rody.png

スクリプト化

# ! /bin/sh
railroady -M | circo -Tpng > ~/${1:-rody}.png
open ~/${1:-rody}.png
23
23
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
23
23

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?