Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ben-ng/geddy-model-inheritance

A small demo on how to extend models in Geddy
https://github.com/ben-ng/geddy-model-inheritance

Last synced: 21 days ago
JSON representation

A small demo on how to extend models in Geddy

Awesome Lists containing this project

README

        

# Inheriting Models In Geddy

This is just a simple demonstration of how you can extend models in Geddy. The `Pizza` model has a `toppings` property, and inherits a `name` property from the `Item` model, which is in `app/helpers` as it doesn't need to be registered.

Just define all your properties and validations as per normal in the `app/helpers/item.js` constructor, and `.apply()` it in `app/models/pizza.js` to inherit those properties.