<commit_before>require! {
	moment
	mongoose
	'../config'
}

db = mongoose.create-connection config.mongo.uri, config.mongo.options

application-schema = new mongoose.Schema do
	name:              {type: String, required: yes}
	user-id:           {type: Number, required: yes}
	created-at:        {type: Date, default: Date.now}
	consumer-key:      {type: String}
	callback-url:      {type: String}
	description:       {type: String, required: yes}
	developer-name:    {type: String}
	developer-website: {type: String}
	is-suspended:      {type: Boolean}

if !application-schema.options.to-object then application-schema.options.to-object = {}
application-schema.options.to-object.transform = (doc, ret, options) ->
	ret.id = doc.id
	#ret.created-at = moment doc.created-at .format 'YYYY/MM/DD HH:mm:ss Z'
	ret

module.exports = db.model \Application application-schema<commit_msg>Update model<commit_after>require! {
	moment
	mongoose
	'../config'
}

Schema = mongoose.Schema

db = mongoose.create-connection config.mongo.uri, config.mongo.options

schema = new Schema do
	name:              {type: String,                required: yes}
	user-id:           {type: Schema.Types.ObjectId, required: yes}
	created-at:        {type: Date,                  required: yes, default: Date.now}
	api-key:           {type: String,                required: yes, unique: yes}
	callback-url:      {type: String,                required: no,  default: null}
	description:       {type: String,                required: yes}
	developer-name:    {type: String,                required: no,  default: null}
	developer-website: {type: String,                required: no,  default: null}
	is-suspended:      {type: Boolean,               required: yes, default: no}

if !schema.options.to-object then schema.options.to-object = {}
schema.options.to-object.transform = (doc, ret, options) ->
	ret.id = doc.id
	#ret.created-at = moment doc.created-at .format 'YYYY/MM/DD HH:mm:ss Z'
	ret

module.exports = db.model \Application schema
{'fraction_non_alphanumeric': 0.12816691505216096, 'fraction_numerical': 0.0, 'mean_word_length': 2.6618181818181816, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4007248', 'n_tokens_mistral': 645, 'n_tokens_neox': 634, 'n_words': 162}