xavierlacot / joli.js

joli.js is an Activerecord-like javascript ORM, particularly suited for being used in the Appcelerator Titanium Mobile framework.
MIT License
267 stars 60 forks source link

fromArray(): Always ensure _originalData is available #48

Closed nicjansma closed 9 years ago

nicjansma commented 9 years ago

Otherwise this statement:

if ((this._originalData && !this._originalData[colName]) || this.isNew()) {
    this._originalData[colName] = data[colName];
}

Might try to set a value on this._originalData when it doesn't exist if this.isNew()

xavierlacot commented 9 years ago

thanks :)