Delete dead code in User model

This commit is contained in:
James Allen 2016-03-08 12:07:50 +00:00
parent 40048d49a2
commit b64c8e3d78

View file

@ -55,32 +55,6 @@ UserSchema = new Schema
# has this set to true, despite never having had a free trial
hadFreeTrial: {type: Boolean, default: false}
UserSchema.statics.getAllIds = (callback)->
this.find {}, ["first_name"], callback
UserSchema.statics.findReadOnlyProjects = (user_id, callback)->
@find({'projects.readOnly_refs':user_id}).populate('projects.readOnly_refs').run (err, users)->
projects = []
_.each users, (user)->
_.each user.projects, (project)->
_.each project.readOnly_refs, (subUser)->
if(subUser._id == user_id)
projects.push(project)
callback(projects)
UserSchema.statics.findCollaborationProjects = (user_id, callback)->
@find({'projects.collaberator_refs':user_id}).populate('projects.collaberator_refs').run (err, users)->
projects = []
_.each users, (user)->
_.each user.projects, (project)->
_.each project.collaberator_refs, (subUser)->
if(subUser._id == user_id)
projects.push(project)
callback(projects)
conn = mongoose.createConnection(Settings.mongo.url, server: poolSize: 10)
User = conn.model('User', UserSchema)