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

Commit 4ebdf979 by Osagie

Excluding attributes with scope.

The key 'titleAttributes' on line 2590 seems to be incorrect. Should be 'attributes', causes a crash when excluding attributes with a scope.

/Users/username/Documents/project_name/node_modules/sequelize/lib/model.js:2590
    var attributes = Object.keys(this.tableAttributes);
                            ^

TypeError: Cannot convert undefined or null to object
    at Function.keys (native)
    at Model.$expandAttributes (/Users/username/Documents/project_name/node_modules/sequelize/lib/model.js:2590:29)
    at conformOptions (/Users/username/Documents/project_name/node_modules/sequelize/lib/model.js:236:10)
    at Model.init (/Users/username/Documents/project_name/node_modules/sequelize/lib/model.js:693:5)
    at Sequelize.define (/Users/username/Documents/project_name/node_modules/sequelize/lib/sequelize.js:586:17)
    at Object.<anonymous> (/Users/username/Documents/project_name/models/account.js:9:25)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at /Users/username/Documents/project_name/models/index.js:9:61
    at Array.forEach (native)
    at Object.<anonymous> (/Users/username/Documents/project_name/models/index.js:6:28)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/Users/username/Documents/project_name/routes/public/business.js:4:14)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)

Process finished with exit code 0
1 parent 332017b6
Showing with 1 additions and 1 deletions
...@@ -2587,7 +2587,7 @@ Model.prototype.$getDefaultTimestamp = function(attr) { ...@@ -2587,7 +2587,7 @@ Model.prototype.$getDefaultTimestamp = function(attr) {
Model.prototype.$expandAttributes = function (options) { Model.prototype.$expandAttributes = function (options) {
if (_.isPlainObject(options.attributes)) { if (_.isPlainObject(options.attributes)) {
var attributes = Object.keys(this.tableAttributes); var attributes = Object.keys(this.attributes);
if (options.attributes.exclude) { if (options.attributes.exclude) {
attributes = attributes.filter(function (elem) { attributes = attributes.filter(function (elem) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!