不要怂,就是干,撸起袖子干!

Commit c6c2d17b by Sushant

feat: deprecate .all

1 parent 1bc8b0e8
Showing with 4 additions and 6 deletions
...@@ -1426,10 +1426,6 @@ class Model { ...@@ -1426,10 +1426,6 @@ class Model {
return self; return self;
} }
static all(options) {
return this.findAll(options);
}
/** /**
* Search for multiple instances. * Search for multiple instances.
* *
...@@ -1495,8 +1491,6 @@ class Model { ...@@ -1495,8 +1491,6 @@ class Model {
* *
* The promise is resolved with an array of Model instances if the query succeeds. * The promise is resolved with an array of Model instances if the query succeeds.
* *
* __Alias__: _all_
*
* @param {Object} [options] A hash of options to describe the scope of the search * @param {Object} [options] A hash of options to describe the scope of the search
* @param {Object} [options.where] A hash of attributes to describe your search. See above for examples. * @param {Object} [options.where] A hash of attributes to describe your search. See above for examples.
* @param {Array<String>|Object} [options.attributes] A list of the attributes that you want to select, or an object with `include` and `exclude` keys. To rename an attribute, you can pass an array, with two elements - the first is the name of the attribute in the DB (or some kind of expression such as `Sequelize.literal`, `Sequelize.fn` and so on), and the second is the name you want the attribute to have in the returned instance * @param {Array<String>|Object} [options.attributes] A list of the attributes that you want to select, or an object with `include` and `exclude` keys. To rename an attribute, you can pass an array, with two elements - the first is the name of the attribute in the DB (or some kind of expression such as `Sequelize.literal`, `Sequelize.fn` and so on), and the second is the name you want the attribute to have in the returned instance
...@@ -4230,6 +4224,10 @@ Model.insertOrUpdate = function () { ...@@ -4230,6 +4224,10 @@ Model.insertOrUpdate = function () {
Utils.deprecate('Model.insertOrUpdate has been deprecated, please use Model.upsert instead'); Utils.deprecate('Model.insertOrUpdate has been deprecated, please use Model.upsert instead');
return Model.upsert.apply(this, arguments); return Model.upsert.apply(this, arguments);
}; };
Model.all = function () {
Utils.deprecate('Model.all has been deprecated, please use Model.findAll instead');
return Model.findAll.apply(this, arguments);
};
Model.prototype.updateAttributes = function () { Model.prototype.updateAttributes = function () {
Utils.deprecate('Instance.updateAttributes has been deprecated, please use Instance.update instead'); Utils.deprecate('Instance.updateAttributes has been deprecated, please use Instance.update instead');
return Model.prototype.update.apply(this, arguments); return Model.prototype.update.apply(this, arguments);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!