Advertisement
Guest User

One to many

a guest
Jul 31st, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Parent
  2. module.exports = {
  3.  
  4.   attributes: {
  5.     text: {type:'string'},
  6.     order: {type:'integer'},
  7.     options: {type:'array'},
  8.     optionType: {type:'string', enum:['single', 'multiple', 'entry']},
  9.  
  10.     //options:{collection:'options'}
  11.  
  12.     survey: {
  13.       model: 'survey'
  14.     }
  15.   }
  16. };
  17.  
  18. //Child
  19. module.exports = {
  20.  
  21.   attributes: {
  22.     text: {type:'string'},
  23.     order: {type:'integer'},
  24.     options: {type:'array'},
  25.     optionType: {type:'string', enum:['single', 'multiple', 'entry']},
  26.  
  27.     //options:{collection:'options'}
  28.  
  29.     survey: {
  30.       model: 'survey'
  31.     }
  32.   }
  33. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement