Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model Inheritance & Polymorphism #168

Open
gmcdowell opened this issue Nov 12, 2016 · 0 comments
Open

Model Inheritance & Polymorphism #168

gmcdowell opened this issue Nov 12, 2016 · 0 comments

Comments

@gmcdowell
Copy link

gmcdowell commented Nov 12, 2016

Hi,

I'm trying to employ inheritance over 3 levels for Models that I use in a LogCollection (polymorphism) and have been attempting to use AssociatedModel for the top level model BaseLog and then extend/specialise to suit my needs:

e.g.
- BaseLog
-- WorkingLog
--- DriveLog
--- RestLog
-- CloseLog

The BaseLog has a Backbone.Many relation property of vehicles and when run the related vehicles collection is present in the BaseLog as you would expect, but in aany of the sub-classes (e.g. WorkingLog, DriveLog, RestLog, CloseLog) it is undefined.

Can you offer any tips as all your tests appear to define an Backbone.AssociatedModel for each class and I don't see this type of inheritance anywhere?

Any advice greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant