Closed weepy closed 10 years ago
I guess that goes in the plugins
section, considering that required
is in that case.
Though, personally I would add both natively.
the nice thing about separating them is that you can easily craft your own "version" of model by forking, and adding those plugins as dependencies, removing any boilerplate you didn't want
yes that makes alot of sense. I did investigate that method, but wasn't sure how to go about doing it. The model:initialize event would make this easier.
yup need the event first
Made a plugin that does this for you: https://github.com/segmentio/model-defaults
ie.
model('Bucket') .attr('count', { default: 0 })