Skip to content

Commit

Permalink
Merge pull request #730 from greim/extend-clone
Browse files Browse the repository at this point in the history
Make Model#_clone return instance of current type
  • Loading branch information
asyncanup committed Aug 6, 2018
2 parents 08b1937 + dbac3e4 commit 6ce342d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Model.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ Model.prototype._syncCheck = function syncCheck(name) {

/* eslint-disable guard-for-in */
Model.prototype._clone = function cloneModel(opts) {
var clone = new Model(this);
var clone = new this.constructor(this);
for (var key in opts) {
var value = opts[key];
if (value === "delete") {
Expand Down

0 comments on commit 6ce342d

Please sign in to comment.