Skip to content
Browse files

add this statement in function create in 182 :var data = obj.toObject…

…(true);
  • Loading branch information...
1 parent e1bd896 commit 4edf268199926236531207afdb9ce7481eca93d9 @by5739 committed May 20, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/abstract-class.js
View
5 lib/abstract-class.js
@@ -160,12 +160,12 @@ AbstractClass.create = function (data, callback) {
// if we come from save
if (data instanceof AbstractClass && !data.id) {
obj = data;
- data = obj.toObject(true);
+ //data = obj.toObject(true);
this.prototype._initProperties.call(obj, data, false);
create();
} else {
obj = new this(data);
- data = obj.toObject(true);
+ //data = obj.toObject(true);
// validation required
obj.isValid(function (valid) {
@@ -179,6 +179,7 @@ AbstractClass.create = function (data, callback) {
function create() {
obj.trigger('create', function (done) {
+ var data = obj.toObject(true);
this._adapter().create(modelName, data, function (err, id) {
if (id) {
defineReadonlyProp(obj, 'id', id);

0 comments on commit 4edf268

Please sign in to comment.
Something went wrong with that request. Please try again.