Build Status Gem Version Code Climate GitHub license Downloads

Rails-ERD-D3

Create entity–relationship diagram with D3.js for your Rails application.

Features

Rails-ERD-D3 contains the following functionality:

View models and their associations

Models

Preferences where you could hide any models

Preferences

View associations

Associations

View table structure

Table structure

Installation

Add these lines to your application's Gemfile:

group :development do
  gem "rails-erd-d3"
end

Install gem:

$ bundle install

And then execute for creating file erd.html:

$ bundle exec rails-erd-d3

Todo

  • Add tests
    • ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:"
  • Sort nodes by label
  • Check associations
    • [X] belongs_to
    • [X] has_one
    • [x] has_many
    • has_many :through
    • has_one :through
    • has_and_belongs_to_many
    • Polymorphic associations
  • Safe as jpg, png
  • Dependent destroy

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/RomanKrasavtsev/rails-erd-d3.

License

The gem is available as open source under the terms of the MIT License.

Author

Roman Krasavtsev, @romankrasavtsev