-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
idk, just the current state, project is ded
- Loading branch information
1 parent
ca8c0f0
commit 8813ccf
Showing
11 changed files
with
62 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[ignore] | ||
|
||
[include] | ||
|
||
[libs] | ||
|
||
[options] |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/** | ||
* Created by ForsakenHarmony on 19/03/17. | ||
*/ |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const mongoose = require('mongoose'); | ||
mongoose.Promise = global.Promise; | ||
const config = require.main.require('./config'); | ||
|
||
const models = require('./models'); | ||
|
||
mongoose.connect(config.mongoHost, 'chime'); | ||
|
||
module.exports = { | ||
mongoose, | ||
User : models.User, | ||
Token : models.Token, | ||
Comment : models.Comment, | ||
Like : models.Like, | ||
Notification: models.Notification, | ||
Post : models.Post, | ||
}; |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/** | ||
* Created by ForsakenHarmony on 19/03/17. | ||
*/ |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
const polymorphic = require('mongoose-polymorphic'); | ||
|
||
exports.init = (mongoose) => { | ||
const Schema = mongoose.Schema; | ||
|
||
const schema = new Schema({ | ||
user : { type: Schema.Types.ObjectId, ref: 'User', required: true }, | ||
notifier : { type: Schema.Types.ObjectId, ref: 'User', required: true }, | ||
type : { type: String, maxlength: 32, required: true }, | ||
created_at: { type: Date, default: Date.now }, | ||
updated_at: { type: Date, default: Date.now }, | ||
}); | ||
|
||
schema.plugin(polymorphic, { | ||
associationKey: 'object', | ||
promise : global.Promise, | ||
required : true | ||
}); | ||
|
||
schema.pre('save', function (next) { | ||
this.updated_at = Date.now(); | ||
next(); | ||
}); | ||
|
||
return mongoose.model('Notifications', schema); | ||
}; |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/** | ||
* Created by ForsakenHarmony on 18/02/17. | ||
*/ |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/** | ||
* Created by ForsakenHarmony on 20/02/17. | ||
*/ |