Added fix to the abstract-class.js file for issue #72. The fix is resolved by by5739.
This commit is contained in:
parent
7a2e300181
commit
913f9d4fc1
|
@ -197,6 +197,10 @@ AbstractClass.create = function (data, callback) {
|
||||||
|
|
||||||
function create() {
|
function create() {
|
||||||
obj.trigger('create', function (done) {
|
obj.trigger('create', function (done) {
|
||||||
|
|
||||||
|
var data = this.toObject(true); // Added this to fix the beforeCreate trigger not fire.
|
||||||
|
// The fix is per issue #72 and the fix was found by by5739.
|
||||||
|
|
||||||
this._adapter().create(modelName, this.constructor._forDB(data), function (err, id) {
|
this._adapter().create(modelName, this.constructor._forDB(data), function (err, id) {
|
||||||
if (id) {
|
if (id) {
|
||||||
defineReadonlyProp(obj, 'id', id);
|
defineReadonlyProp(obj, 'id', id);
|
||||||
|
|
Loading…
Reference in New Issue