Skip to content

Commit

Permalink
Merge branch 'master' of github.com:eerenyuan/bookshelf
Browse files Browse the repository at this point in the history
  • Loading branch information
eerenyuan committed Sep 19, 2018
2 parents 2510355 + 58ddd95 commit 2705e15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/base/model.js
Expand Up @@ -643,7 +643,7 @@ ModelBase.prototype.timestamp = function(options) {
const updatedAtKey = timestampKeys[1];
const isNewModel = method === 'insert';

if (updatedAtKey && (isNewModel || this.hasChanged())) {
if (updatedAtKey && (isNewModel || this.hasChanged()) && !this.hasChanged(updatedAtKey) ) {
attributes[updatedAtKey] = now;
}

Expand Down

0 comments on commit 2705e15

Please sign in to comment.