Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Creating afterUpdate hook using the mixin function causes TypeError #3901
The first runs correctly, the second causes this error:
From what I see from sources and docs (3rd version), adding a hook like this is not supported.
db.Version.afterUpdate( 'update_CurrentVersion', update_CurrentVersion );
You can pass only callback argument thus it's not a bug. So a quick workaround in your case would be:
db.Version.addHook( 'afterUpdate', 'update_CurrentVersion', update_CurrentVersion ); db.Version.afterUpdate( update_CurrentVersion );
But I guess that would be a good feature to have so I'll implement this.