Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. import DS from 'ember-data';
  2.  
  3. export default DS.Model.extend({
  4. name: DS.attr('string'),
  5.  
  6. projects: DS.hasMany('project'),
  7. users: DS.hasMany('user'),
  8. members: Ember.computed('users', function() {
  9. return this.get('users.content.length');
  10. }),
  11. leader: DS.belongsTo('user', {
  12. inverse: 'team'
  13. })
  14. });
  15.  
  16. import ApplicationSerializer from './application';
  17. import DS from 'ember-data';
  18.  
  19. export default ApplicationSerializer.extend(DS.EmbeddedRecordsMixin,{
  20. attrs: {
  21. users: { async: true },
  22. projects: { async: true }
  23. }
  24. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement