3 ms·
Thanks for catching that. I've removed the outdated paragraph and republished the docs. If you notice anything else amiss, please let me know.
by jashkenas 14y ago
Thanks for catching that. I've removed the outdated paragraph and republished the docs. If you notice anything else amiss, please let me know.
- hueyp 14y agoThanks, I was honestly confused, not trying to nit pick. --- Anyone know the best way to make it so set defaults to {validate:true}? Override Backbone.Model.set, extend options and call original?
- philfreo 14y agoSure (though I recommend just updating your code instead...) Only reason it's tricky is because there are two different forms of attributes that can be passed to set. Something like this should work: var oldSet = Backbone.Model.prototype.set; Backbone.Model.prototype.set = function(key, val, options) { if (key == null) return this; if (typeof key === 'object') { options = val; } options || (options = {}); options.validate = true; oldSet.call(this, key, val, options); };