Giter Club home page Giter Club logo

rails-erd's Introduction

Rails ERD - Generate Entity-Relationship Diagrams for Rails applications

Build Status Code Climate

Rails ERD is a gem that allows you to easily generate a diagram based on your application's Active Record models. The diagram gives an overview of how your models are related. Having a diagram that describes your models is perfect documentation for your application.

The second goal of Rails ERD is to provide you with a tool to inspect your application's domain model. If you don't like the default output, it is very easy to use the API to build your own diagrams.

Rails ERD was created specifically for Rails and works on versions 3.0-5.0. It uses Active Record's built-in reflection capabilities to figure out how your models are associated.

Preview

Here's an example entity-relationship diagram that was generated by Rails ERD:

Entity-Relationship Diagram

Browse the gallery for more example diagrams.

Requirements

  • Ruby 1.9.3+
  • ActiveRecord 3.x - 5.0.x

Getting started

See the installation instructions for a complete description of how to install Rails ERD. Here's a summary:

  • Install Graphviz 2.22+ (how?). On macOS with Homebrew run brew install graphviz.

  • Add gem 'rails-erd', group: :development to your application's Gemfile

  • Run bundle exec erd

Configuration

Rails ERD has the ability to be configured via the command line or through the use of a YAML file with configuration options set. It will look for this file first at ~/.erdconfig and then ./.erdconfig (which will override any settings in ~/.erdconfig). The format of the file is as follows (shown here with the default settings used if no .erdconfig is found). More information on customization options can be found in Rails ERD's project documentation.

attributes:
  - content
  - foreign_key
  - inheritance
disconnected: true
filename: erd
filetype: pdf
indirect: true
inheritance: false
markup: true
notation: simple
orientation: horizontal
polymorphism: false
sort: true
warn: true
title: sample title
exclude: null
only: null
only_recursion_depth: null
prepend_primary: false
cluster: false
splines: spline

Auto generation

  • Run bundle exec rails g erd:install
  • Run bundle exec rails db:migrate, then the diagram is generated

Learn more

More information can be found on Rails ERD's project homepage.

If you wish to extend or customise Rails ERD, take a look at the API documentation.

About Rails ERD

Rails ERD was created by Rolf Timmermans (r.timmermans at voormedia.com)

Copyright 2010-2015 Voormedia - www.voormedia.com

License

Rails ERD is released under the MIT license.

rails-erd's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.