Model inheritance #332

stijnbe opened this Issue Mar 18, 2013 · 1 comment


None yet
3 participants

stijnbe commented Mar 18, 2013

How would you implement model inheritance using Geddy? Let's say you wan't a model for animal, dog and cat. Where dog and cat inherit from animal.


mde commented Mar 18, 2013

ActiveRecord supports single-table inheritance, like this:

Our Model layer doesn't support this yet. The best way to work around this at present is to use composition instead. .So, for example, instead of having an Admin type that descends from User, you'd add an associated AdminRole to the User, that adds the administrative capabilities.

I've added a ticket for Model for this: mde/model#37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment