UNPKG

ember-rocks

Version:

An Em(ber) command line utility to help you build an ambitious web application

20 lines (16 loc) 500 B
import DS from 'ember-data'; // http://emberjs.com/guides/models/defining-models/ var attr = DS.attr; var hasMany = DS.hasMany; var UserModel = DS.Model.extend({ idField: attr(), firstName: attr('string'), lastName: attr('string'), occupation: attr('string'), // lookup for models/other.js others: hasMany('other'), fullName: function () { return this.get('firstName') + ' ' + this.get('lastName'); }.property('firstName', 'lastName') }); export default UserModel;