rails-erd icon indicating copy to clipboard operation
rails-erd copied to clipboard

[BRAINSTORMING] Other ways of generating the graph data

Open kerrizor opened this issue 7 years ago • 1 comments

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.

kerrizor avatar Mar 31 '17 17:03 kerrizor

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.

Nerian avatar May 18 '17 12:05 Nerian