rails-erd
rails-erd copied to clipboard
[BRAINSTORMING] Other ways of generating the graph data
Since we walk the ActiveRecord relationships built as the Rails app spins up, its hard for us to find these other models. That's something I occasionally think about changing, but even the other approaches I've considered are still dependent on the ActiveRecord declarations existing in the app space itself. For example
- We /could/ just grep
app/models/*
and build out the relationship tree from that, but its unreliable if models exist outside those files - We /could/ walk the schema, but we'd have to make assumptions about foreign keys being set correctly and consistently.
How about supporting both methods via a config value?
Having both will allow us to spot differences. For example, you may be able to spot that you should be using a foreign_key.