Skip to content

Commit

Permalink
Add task to generate diagram
Browse files Browse the repository at this point in the history
Added by the gem's generator:

```
bundle exec rails g erd:install
```

We can run this task to generate an entity-relationship diagram e.g.

```
bundle exec rails db:migrate \
	indirect=true \
	inheritance=true \
	polymorphism=true \
	title="Complete (Ruby)" \
	filename="doc/complete-auto-generated-entity-relationship-diagram"
```

See https://voormedia.github.io/rails-erd/customise.html for available
options.

We include the generated diagram in PDF form in our `doc` directory.
  • Loading branch information
edavey committed Dec 4, 2024
1 parent d66a1e0 commit 235bb93
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Binary file not shown.
8 changes: 8 additions & 0 deletions lib/tasks/auto_generate_diagram.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 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.
# :nocov:
if Rails.env.development?
RailsERD.load_tasks
end
# :nocov:

0 comments on commit 235bb93

Please sign in to comment.