clean up database model setting

This commit is contained in:
Eric Hulburd
2016-01-31 17:49:02 -06:00
parent c0efde030d
commit 51a0e40f55
7 changed files with 114 additions and 76 deletions

View File

@@ -34,7 +34,13 @@ var PowerDatum = DB.sequelize.define(NAME, {
},
classMethods: {
set: ()=>{
PowerDatum.associate();
PowerDatum.defineGraphQLType();
},
associate: ()=>{
PowerDatum.belongsTo(DB.House);
},
defineGraphQLType: ()=>{
PowerDatum.graphql_type = new GraphQLObjectType({
name: NAME,
description: 'A person who uses our app',