Last active
November 27, 2015 23:59
-
-
Save oscaroceguera/a33f8e5538a37559fbf7 to your computer and use it in GitHub Desktop.
category model
This file contains hidden or 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
var Bookshelf = require('../commons/bookshelf'); | |
Bookshelf.plugin('registry'); | |
var Post = require('./post'); | |
var Category = Bookshelf.Model.extend({ | |
tableName: 'categories', | |
hasTimestamps: true, | |
posts : function () { | |
return this.hasMany('Post'); | |
} | |
}); | |
module.exports = Bookshelf.model('Category', Category); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment