Skip to content

Commit

Permalink
Merge pr/451. Closes #451
Browse files Browse the repository at this point in the history
  • Loading branch information
dxg committed Feb 18, 2014
1 parent ac631bf commit 9f335e9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
15 changes: 10 additions & 5 deletions lib/Associations/Many.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ function extendInstance(Model, Instance, Driver, association, opts, createInstan
});
return this;
},
enumerable: false
enumerable: false,
writable: true
});
Object.defineProperty(Instance, association.getAccessor, {
value: function () {
Expand Down Expand Up @@ -228,7 +229,8 @@ function extendInstance(Model, Instance, Driver, association, opts, createInstan
association.model.find(conditions, options, cb);
return this;
},
enumerable: false
enumerable: false,
writable: true
});
Object.defineProperty(Instance, association.setAccessor, {
value: function () {
Expand All @@ -247,7 +249,8 @@ function extendInstance(Model, Instance, Driver, association, opts, createInstan

return this;
},
enumerable: false
enumerable: false,
writable: true
});
Object.defineProperty(Instance, association.delAccessor, {
value: function () {
Expand Down Expand Up @@ -299,7 +302,8 @@ function extendInstance(Model, Instance, Driver, association, opts, createInstan
}
return this;
},
enumerable: false
enumerable: false,
writable: true
});
Object.defineProperty(Instance, association.addAccessor, {
value: function () {
Expand Down Expand Up @@ -402,7 +406,8 @@ function extendInstance(Model, Instance, Driver, association, opts, createInstan

return this;
},
enumerable: false
enumerable: false,
writable: true
});
}

Expand Down
12 changes: 8 additions & 4 deletions lib/Associations/One.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ function extendInstance(Model, Instance, Driver, association) {

return this;
},
enumerable: false
enumerable: false,
writable: true
});
Object.defineProperty(Instance, association.getAccessor, {
value: function (opts, cb) {
Expand Down Expand Up @@ -197,7 +198,8 @@ function extendInstance(Model, Instance, Driver, association) {

return this;
},
enumerable: false
enumerable: false,
writable: true
});
Object.defineProperty(Instance, association.setAccessor, {
value: function (OtherInstance, cb) {
Expand Down Expand Up @@ -251,7 +253,8 @@ function extendInstance(Model, Instance, Driver, association) {

return this;
},
enumerable: false
enumerable: false,
writable: true
});
if (!association.reversed) {
Object.defineProperty(Instance, association.delAccessor, {
Expand All @@ -271,7 +274,8 @@ function extendInstance(Model, Instance, Driver, association) {

return this;
},
enumerable: false
enumerable: false,
writable: true
});
}
}
Expand Down

0 comments on commit 9f335e9

Please sign in to comment.