Skip to content

Commit 02fa568

Browse files
committed
Models moved to an index file; one-place registration
1 parent f3d2ed7 commit 02fa568

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

generated/server/db/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var db = mongoose.connect(DATABASE_URI).connection;
1111
// Require our models -- these should register the model into mongoose
1212
// so the rest of the application can simply call mongoose.model('User')
1313
// anywhere the User model needs to be used.
14-
require('./models/user');
14+
require('./models');
1515

1616
var startDbPromise = new Q(function (resolve, reject) {
1717
db.on('open', resolve);

generated/server/db/models/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Require our models -- these should register the model into mongoose
2+
// so the rest of the application can simply call mongoose.model('User')
3+
// anywhere the User model needs to be used.
4+
require('./user');

0 commit comments

Comments
 (0)