Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sequelize 4 #76

Closed
zazoomauro opened this issue Jun 13, 2017 · 2 comments
Closed

Sequelize 4 #76

zazoomauro opened this issue Jun 13, 2017 · 2 comments

Comments

@zazoomauro
Copy link

zazoomauro commented Jun 13, 2017

I'm testing sequelize-fixtures with sequelize version 4

Source code

import sequelizeFixtures from 'sequelize-fixtures';

let orm = new Sequelize(this._config.database.name, ...)
let fixtures = ['./lib/resources/fixtures/user.json'];

return sequelizeFixtures.loadFiles(fixtures, orm.models);

OUTPUT

Error: models.User appears to be a function. 
Perhaps you are importing model factory function? 
You should then use sequelize.import to create your model, see https://github.com/sequelize/express-example/blob/master/models/index.js#L17

Same piece of code works like a charm with sequelize version 3

@iagomelanias
Copy link

iagomelanias commented Jun 13, 2017

Seems like there is an already opened PR fixing this issue. (#75)

@zazoomauro
Copy link
Author

@iagomelanias true!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants