From 90190e417effb246da1fb1a3a6bd22c16bc6ff6c Mon Sep 17 00:00:00 2001 From: Raniere Silva Date: Fri, 5 Jun 2020 12:12:40 -0300 Subject: [PATCH] Add findByPk as alias to findById Related to https://github.com/BlinkUX/sequelize-mock/issues/84 --- src/model.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/model.js b/src/model.js index 313f447..8a93f96 100644 --- a/src/model.js +++ b/src/model.js @@ -343,10 +343,13 @@ fakeModel.prototype.findAndCountAll = function (options) { * to `false`. * * @instance + * @method findByPk + * @alias findById * @param {Integer} id ID of the instance * @return {Promise} Promise that resolves with an instance with the given ID **/ -fakeModel.prototype.findById = function (id) { +fakeModel.prototype.findById = +fakeModel.prototype.findByPk = function (id) { var self = this; return this.$query({