Comparing version 0.0.14 to 0.0.16
@@ -73,7 +73,25 @@ // Generated by CoffeeScript 1.6.2 | ||
/* | ||
Hydrates the data and compares the current data to make sure this shit doesn't get overridden. | ||
*/ | ||
LinenModel.prototype.hydrate = function(key, value) { | ||
this.set.apply(this, arguments); | ||
LinenModel.prototype.hydrate = function(data) { | ||
var cv, key, nv; | ||
for (key in data) { | ||
cv = this.get(key); | ||
nv = data[key]; | ||
if (cv) { | ||
if (cv.__isBindable) { | ||
cv = cv.get("_id"); | ||
} else if (cv.__isCollection) { | ||
delete data[key]; | ||
continue; | ||
} | ||
} | ||
if (cv === nv) { | ||
delete data[key]; | ||
} | ||
} | ||
this.set(data); | ||
this._update = {}; | ||
@@ -95,5 +113,5 @@ return this; | ||
LinenModel.prototype.bind = function() { | ||
this.fetch(); | ||
return LinenModel.__super__.bind.apply(this, arguments); | ||
LinenModel.prototype.get = function() { | ||
this._initFetch(); | ||
return LinenModel.__super__.get.apply(this, arguments); | ||
}; | ||
@@ -122,2 +140,14 @@ | ||
LinenModel.prototype._initFetch = function() { | ||
if (this._fetched) { | ||
return; | ||
} | ||
this._fetched = true; | ||
return this.fetch(); | ||
}; | ||
/* | ||
*/ | ||
LinenModel.prototype._request = cstep(function(options, next) { | ||
@@ -124,0 +154,0 @@ var _this = this; |
{ | ||
"name": "linen", | ||
"version": "0.0.14", | ||
"version": "0.0.16", | ||
"description": "```javascript", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51427
1208