Skip to content

Commit

Permalink
Fix import of sequelize data types
Browse files Browse the repository at this point in the history
  • Loading branch information
saschagehlich committed May 24, 2018
1 parent 120bd9d commit fe75c52
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
17 changes: 9 additions & 8 deletions dist/sequenice.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ module.exports = require("path");
/* 4 */
/***/ (function(module, exports) {

module.exports = require("sequelize/lib/data-types");
module.exports = require("sequelize");

/***/ }),
/* 5 */
Expand Down Expand Up @@ -127,9 +127,7 @@ var _globule = __webpack_require__(1);

var _globule2 = _interopRequireDefault(_globule);

var _dataTypes = __webpack_require__(4);

var _dataTypes2 = _interopRequireDefault(_dataTypes);
var _sequelize = __webpack_require__(4);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

Expand All @@ -151,7 +149,8 @@ var Sequenize = function () {
modelsDirectory: null,
modelsAttacher: global,
getterPrefix: '_get',
setterPrefix: '_set'
setterPrefix: '_set',
modelsMatch: /\.(js|coffee)$/i
});

this._loadModels();
Expand Down Expand Up @@ -189,7 +188,9 @@ var Sequenize = function () {

var files = _globule2.default.find('**/*', {
cwd: modelsDirectory,
filter: 'isFile'
filter: function filter(f) {
return _fs2.default.statSync(f).isFile() && _this._options.modelsMatch.test(f);
}
});

files.forEach(function (file) {
Expand Down Expand Up @@ -491,8 +492,8 @@ var Sequenize = function () {
}, {
key: '_attachDataTypesToMap',
value: function _attachDataTypesToMap(map) {
for (var key in _dataTypes2.default) {
map[key] = _dataTypes2.default[key];
for (var key in _sequelize.DataTypes) {
map[key] = _sequelize.DataTypes[key];
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/sequenice.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import fs from 'fs'
import _ from 'lodash'

import globule from 'globule'
import DataTypes from 'sequelize/lib/data-types'
import { DataTypes } from 'sequelize'

export default class Sequenize {
constructor (sequelize, options) {
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = {
externals: {
globule: 'commonjs globule',
lodash: 'commonjs lodash',
'sequelize/lib/data-types': 'commonjs sequelize/lib/data-types'
sequelize: 'commonjs sequelize'
},

module: {
Expand Down

0 comments on commit fe75c52

Please sign in to comment.