File: //var/dev/irantv2.com/rest/api/models/Book.js
/**
* Tags.js
*
* @description :: TODO: You might write a short summary of how this model works and what it represents here.
* @docs :: http://sailsjs.org/documentation/concepts/models-and-orm/models
*/
module.exports = {
attributes: {
title: {
type: 'string',
},
altTitles: {
type: 'json',
columnType: 'array',
},
poster: {
type: 'string'
},
primaryFiles: {
type: 'ref'
},
secondaryFiles: {
type: 'ref'
},
desc: {
type: 'string'
},
authDate: {
type: 'number'
},
authDateAccuracy: {
type: 'number'
},
state: {
type: 'string',
isIn: ['published', 'draft'],
defaultsTo: 'published'
},
tags: {
collection: 'tag',
via: 'books',
dominant: true
},
persons: {
collection: 'person',
via: 'book',
through: 'personbook'
},
episodes: {
collection: 'episode',
via: 'book',
through: 'episodebook'
},
articles: {
collection: 'article',
via: 'books'
},
},
};