amberframework / granite

ORM Model with Adapters for mysql, pg, sqlite in the Crystal Language.
MIT License
297 stars 87 forks source link

Can't subclass a subclass of Granite::Base? #500

Open Eldomir opened 1 year ago

Eldomir commented 1 year ago

This might just be ignorance, but I didn't know where to ask exactly. I have a class "Entity" which is a subclass of Granite::Base, and when I try to subclass Entity into Item, I get the following error:

"Error: can't annotate @new_record in Item because it was first defined in Entity"

Does this mean I can't use inheritance for any of my classes that inherit from Granite::Base?

hugopl commented 10 months ago

I believe this very same issue also blocks the use of a rails-like pattern of having a ApplicationRecord class as base class for all models, I get the same error.