File: //var/dev/irantv2.com/rest/api/models/Article.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',
},
files: {
type: 'ref'
},
citation: {
type: 'string'
},
desc: {
type: 'string'
},
authDate: {
type: 'number'
},
state: {
type: 'string',
isIn: ['published', 'draft'],
defaultsTo: 'published'
},
tags: {
collection: 'tag',
via: 'articles',
dominant: true
},
books: {
collection: 'book',
via: 'articles',
dominant: true
},
places: {
collection: 'place',
via: 'articles',
dominant: true
},
persons: {
collection: 'person',
via: 'articles',
dominant: true
},
authors: {
collection: 'person',
via: 'article',
through: 'articleauthor'
},
},
};