-
Notifications
You must be signed in to change notification settings - Fork 68
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
hasPaperTrail is not a function - sequelize ^5.0.0-beta.13 #66
Comments
Thanks for the heads up :) I'll check it out soon and see what I need to change to make it work, first need to work out a few bugs with the current library. |
@matyaspeto ok I got it working in a test version, I'll create a branch for it later today and try to push a beta version by tomorrow. |
Any updates when this branch might be available/ready? I've been tasked with migrating from Sequelize 4 to 5 because of sequelize/sequelize#8468. |
I'm kind of confused. What does |
Any progress on releasing v4? |
Correction, should work with Sequelize v5 👍 |
@nielsgl Thanks for the update & clarification! I'm heads-down on another task at the moment, but will prioritize revisiting this as soon as I can carve out some time then will report back with any findings. |
I'll be giving it a try on monday, thanks a lot though! |
Alright, so tried it out: Two things I noticed immediately: You must have left a test variable or something in the exports in /dist/helpers.js:112:3 (see here I think). Trying to run that errors out with I also noticed that rc.7 depends on sequelize 4.x and installs that as a dependency (which it probably uses instead of the project's sequelize 5) The .hasPaperTrail function on models unfortunately is still undefined. This is my code: sqlize.import(resolve(__dirname, "./models", "Users.js"));
const PaperTrail = papertrail.init(sqlize, {
userModel: "Users",
debug: commander.debug
});
PaperTrail.defineModels();
let models = await fs.readdir(resolve(__dirname, "./models"));
models.forEach(model => {
log.debug("Importing Model '" + model + "'");
const mdl = sqlize.import(resolve(__dirname, "./models", model));
if (mdl.hasPaperTrail) mdl.Revisions = mdl.hasPaperTrail();
}); Breakpointing at Ln13 and using the debugger to verify hasPaperTrail's value gives me |
Ok fixed this 👍
Moved the dependency to dev dependencies so that should fix this. I'll try tonight to quickly test it to get it working. |
@Wolvan I think it's fixed now, at least the tests are passing with Sequelize v5. Released as |
Alright, mdl.hasPaperTrail is now defined and successfully defines a Revision prop on the models. Haven't looked deeper into it yet, but it looks promising enough! |
Hi. when I tried to save a new user, user inserted to postgres but I gave this error in console: |
try passing |
Hi,
in this version of Sequelize, apparently the
_.extend(sequelize.Model)
has no effect.I tried to fix it in several way without any success :(
The text was updated successfully, but these errors were encountered: