i have an asset class which have type, name, label etc.
Asset types are: avatar, image, video, summary etc.
I want to have Video < Asset type only for type = ‘video’, but for all other types – Asset should be used.
If i use self.inheritance_column = ‘type’ – it fails, because cant find Avatar class.
Is there any approach how to map all types to Asset class except video?
Thanks,
Kirill Salykin
That won’t work. You’re either doing STI with those types or you aren’t.
The way to do it is use
typeas your STI column, and something likeasset_typeas your categorization column. Then only video gets thetypecolumn, all other assets use theasset_typecolumn to tell what’s what.