Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import DS from 'ember-data';
- export default DS.Model.extend({
- name: DS.attr('string'),
- projects: DS.hasMany('project'),
- users: DS.hasMany('user'),
- members: Ember.computed('users', function() {
- return this.get('users.content.length');
- }),
- leader: DS.belongsTo('user', {
- inverse: 'team'
- })
- });
- import ApplicationSerializer from './application';
- import DS from 'ember-data';
- export default ApplicationSerializer.extend(DS.EmbeddedRecordsMixin,{
- attrs: {
- users: { async: true },
- projects: { async: true }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement