-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(events): mongoose event registration
As of `[email protected]` schema events should be registered before the model is compiled fixes #2479
- Loading branch information
Showing
4 changed files
with
25 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
'use strict'; | ||
|
||
import mongoose from 'mongoose'; | ||
import {registerEvents} from './<%= basename %>.events'; | ||
|
||
var <%= classedName %>Schema = new mongoose.Schema({ | ||
name: String, | ||
info: String, | ||
active: Boolean | ||
}); | ||
|
||
registerEvents(<%= classedName %>Schema); | ||
export default mongoose.model('<%= classedName %>', <%= classedName %>Schema); |