<commit_before>'use strict';

var mongoose = require('mongoose'),
  Schema = mongoose.Schema,
  archive = require('./archive.js');


var TaskSchema = new Schema({
  created: {
    type: Date,
    default: Date.now
  },
  updated: {
    type: Date
  },  
  title: {
    type: String,
    required: true,
    default: 'New Task'
  },
  project : {
    type: Schema.ObjectId,
    ref: 'Project',
    required: true
  },
  parent : {
    type: Schema.ObjectId,
    ref: 'Task'
  },
  creator: {
    type: Schema.ObjectId,
    ref: 'User'
  },
  manager: {
    type: Schema.ObjectId,
    ref: 'User'
  },
  tags: [ String],
  status: {
    type: String,
    enum: ['Received', 'Completed'],
    default: 'Received'
  },
  due: {
    type: Date,
  },
  //should we maybe have finer grain control on this
  watchers : [{
    type: Schema.ObjectId,
    ref: 'User'
  }],
  assign : [{
    type: Schema.ObjectId,
    ref: 'User'
  }]
});

/**
 * Validations
 */
TaskSchema.path('title').validate(function(title) {
  return !!title;
}, 'Title cannot be blank');

/**
 * Statics
 */
TaskSchema.statics.load = function(id, cb) {
  this.findOne({
    _id: id<commit_msg>add description to task<commit_after>'use strict';

var mongoose = require('mongoose'),
  Schema = mongoose.Schema,
  archive = require('./archive.js');


var TaskSchema = new Schema({
  created: {
    type: Date,
    default: Date.now
  },
  updated: {
    type: Date
  },  
  title: {
    type: String,
    required: true,
    default: 'New Task'
  },
  project : {
    type: Schema.ObjectId,
    ref: 'Project',
    required: true
  },
  parent : {
    type: Schema.ObjectId,
    ref: 'Task'
  },
  creator: {
    type: Schema.ObjectId,
    ref: 'User'
  },
  manager: {
    type: Schema.ObjectId,
    ref: 'User'
  },
  tags: [ String],
  status: {
    type: String,
    enum: ['Received', 'Completed'],
    default: 'Received'
  },
  due: {
    type: Date,
  },
  //should we maybe have finer grain control on this
  watchers : [{
    type: Schema.ObjectId,
    ref: 'User'
  }],
  assign : [{
    type: Schema.ObjectId,
    ref: 'User'
  }],
  description: {
    type: String
  }
});

/**
 * Validations
 */
TaskSchema.path('title').validate(function(title) {
  return !!title;
}, 'Title cannot be blank');

/**
 * Statics
 */
TaskSchema.statics.load = function(id, cb) {
  this.findOne({
    _id: id
{'fraction_non_alphanumeric': 0.1637748624629708, 'fraction_numerical': 0.0, 'mean_word_length': 2.554887218045113, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3302807', 'n_tokens_mistral': 835, 'n_tokens_neox': 837, 'n_words': 203}