aboutsummaryrefslogtreecommitdiffstats
path: root/src/Model.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/Model.js')
-rw-r--r--src/Model.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Model.js b/src/Model.js
index 4a3a1806..b09efd0e 100644
--- a/src/Model.js
+++ b/src/Model.js
@@ -3,9 +3,9 @@
function Model(entity, initial) {
this['$$entity'] = entity;
- this.$loadFrom(initial||{});
- this.$entity = entity['title'];
- this.$migrate();
+ this['$loadFrom'](initial||{});
+ this['$entity'] = entity['title'];
+ this['$migrate']();
};
Model.copyDirectFields = function(src, dst) {
@@ -25,9 +25,9 @@ Model.copyDirectFields = function(src, dst) {
}
};
-Model.prototype = {
+extend(Model.prototype, {
'$migrate': function() {
- merge(this['$$entity'].defaults, this);
+ merge(this['$$entity']['defaults'], this);
return this;
},
@@ -62,4 +62,4 @@ Model.prototype = {
Model.copyDirectFields(this, other);
return this;
}
-}; \ No newline at end of file
+}); \ No newline at end of file