rails-erd
rails-erd copied to clipboard
inheriting model class shows as a table
Hi,
I have a special use case, i don't think its handled properly.
I'm inheriting a model to have different validations but I'm not using STI
class Animal < AR::Base; end
class Dog < Animal; end
in my generated ERD, Dog shows up as a separate table. I'd like to have it as a grayed inheritance class
I'm not familiar with the code base, i don't know if this is easily fixable?
thanks
Thanks for your gem by the way, its awesome
@mathieujobin Interesting! I'll dig into the ActiveRecord metadata and see if I can extract this information easily.. I believe it /should/ be, but it might be a case where we need to cross-reference the #table_name
against the ancestor(s) of the class.
To be clear, in your example, Dog and Animal are using the same table, but you're not using AR's STI features?
I wonder if something like what we did in voormedia/rails-erd#205 would look ok?
that's right, same table, inherit one another, but no STI features
is this a quick fix? if at least the diagram box would not be floating, and showing an inheritance line to its parent, I'd be happy
dashed box might sound good because its not a separate table.
@mathieujobin Is this still an issue? I've been thinking about how to test this, given how much reliance we have on AR internals in our setup/teardown..