Mailspring/core/models/shared/account.js
2016-06-19 03:02:32 -07:00

21 lines
460 B
JavaScript

module.exports = (sequelize, Sequelize) => {
const Account = sequelize.define('Account', {
emailAddress: Sequelize.STRING,
}, {
classMethods: {
associate: ({AccountToken}) => {
Account.hasMany(AccountToken, {as: 'tokens'})
},
},
instanceMethods: {
toJSON: function toJSON() {
return {
id: this.id,
email_address: this.emailAddress,
}
},
},
});
return Account;
};