Everyplay / serverbone

Backbone node.js additions to serve backbone collections/models over express
MIT License
5 stars 5 forks source link

An auto-cleanup property for relations #12

Open mzabaluev opened 9 years ago

mzabaluev commented 9 years ago

It would be nice to support a flag in schema for relation properties that would make Serverbone remove the related models' data when the relating model is destroyed. Currently the model's implementation has to do the cleanup explicitly, which is contrary to the idea of schematically defined relations.

Ideas on a mnemonic name for the feature are welcome. This might be done as a general marker for a parent-child relation. In the SQL world the equivalent feature is typically implemented with ON DELETE CASCADE.