不要怂,就是干,撸起袖子干!

Commit f2fc8040 by Jonatan Männchen Committed by Jonatan Männchen

Recursive Extend Model Default Options for getterMethods and setterMethods

If I define default getters and setters and create a Modle with some getter / setters themselves, the default ones won't be added.

I think we should handle getters & setters the same way we handle classMethods & instanceMethods.
1 parent dee58c69
Showing with 1 additions and 1 deletions
...@@ -534,7 +534,7 @@ module.exports = (function() { ...@@ -534,7 +534,7 @@ module.exports = (function() {
if (globalOptions.define) { if (globalOptions.define) {
options = Utils._.extend({}, globalOptions.define, options); options = Utils._.extend({}, globalOptions.define, options);
Utils._(['classMethods', 'instanceMethods']).each(function(key) { Utils._(['classMethods', 'instanceMethods', 'getterMethods', 'setterMethods']).each(function(key) {
if (globalOptions.define[key]) { if (globalOptions.define[key]) {
options[key] = options[key] || {}; options[key] = options[key] || {};
Utils._.defaults(options[key], globalOptions.define[key]); Utils._.defaults(options[key], globalOptions.define[key]);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!