Skip to content
This repository has been archived by the owner on Dec 24, 2020. It is now read-only.

Commit

Permalink
Merge pull request #24 from connorshea/add-rails-erd
Browse files Browse the repository at this point in the history
Add Rails ERD and generate a diagram of the app structure.
  • Loading branch information
connorshea committed Apr 28, 2018
2 parents c127292 + 09cf80b commit 816c41c
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .erdconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
exclude: ActiveRecord::InternalMetadata, ActiveRecord::SchemaMigration
attributes:
- content
- foreign_key
- inheritance
filename: erd
filetype: png
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ group :development do
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
gem 'annotate', '~> 2.7'
gem 'rails-erd', '~> 1.5', require: false
end

group :test do
Expand Down
8 changes: 8 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ GEM
chartkick (2.3.4)
childprocess (0.9.0)
ffi (~> 1.0, >= 1.0.11)
choice (0.2.0)
chromedriver-helper (1.2.0)
archive-zip (~> 0.10)
nokogiri (~> 1.8)
Expand Down Expand Up @@ -153,6 +154,11 @@ GEM
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-erd (1.5.2)
activerecord (>= 3.2)
activesupport (>= 3.2)
choice (~> 0.2.0)
ruby-graphviz (~> 1.2)
rails-html-sanitizer (1.0.4)
loofah (~> 2.2, >= 2.2.2)
railties (5.2.0)
Expand All @@ -165,6 +171,7 @@ GEM
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
ruby-graphviz (1.2.3)
ruby_dep (1.5.0)
rubyzip (1.2.1)
sass (3.5.6)
Expand Down Expand Up @@ -232,6 +239,7 @@ DEPENDENCIES
pg_search (~> 2.1)
puma (~> 3.11)
rails (~> 5.2.0)
rails-erd (~> 1.5)
sass-rails (~> 5.0)
selenium-webdriver
spring
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ To view all dependencies used in this project, see the [`Gemfile`](/Gemfile) and

## Notes

### Architecture

![ERD](erd.png)

### Resources

- [Using PostgreSQL and jsonb with Ruby on Rails](https://nandovieira.com/using-postgresql-and-jsonb-with-ruby-on-rails) is a really useful article for understanding jsonb usage with Postgres and Rails (this is used in this app).
Expand Down
Binary file added erd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions lib/tasks/auto_generate_diagram.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# NOTE: only doing this in development as some production environments (Heroku)
# NOTE: are sensitive to local FS writes, and besides -- it's just not proper
# NOTE: to have a dev-mode tool do its thing in production.
if Rails.env.development?
RailsERD.load_tasks
end

0 comments on commit 816c41c

Please sign in to comment.