Skip to content

Instantly share code, notes, and snippets.

@michelalbers
Last active August 29, 2015 14:07
Show Gist options
  • Save michelalbers/16172510a7152f18cb33 to your computer and use it in GitHub Desktop.
Save michelalbers/16172510a7152f18cb33 to your computer and use it in GitHub Desktop.
// Generated by CoffeeScript 1.7.1
var AlbumModel, Model;
Model = require('./basemodel');
require('./user');
require('./photo');
require('./like');
AlbumModel = (function(base) {
base.setProperties({
title: {
type: String,
required: true
},
description: {
type: String,
required: true
},
date: {
type: Date,
"default": Date.now
}
});
base.addRelation('user', 'User', true, false);
base.addRelation('likes', 'Like', false, true);
base.addRelation('photos', 'Photo', false, true);
base.addRelation('comments', 'Comment', false, true);
return base;
})(Model);
module.exports = AlbumModel.compileModel("Album");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment