UNPKG

@speakr/speakr-module-services

Version:
20 lines (17 loc) 364 B
'use strict'; let _ = require('underscore'); module.exports = function(sequelize, DataTypes) { return sequelize.define('products', { name: { type: DataTypes.STRING, allowNull: true } }, { instanceMethods: { toPublicJSON: function() { let json = this.toJSON(); return _.pick(json, 'name'); } } }); };