2016-01-28 23:48:14 +01:00
|
|
|
import DS from 'ember-data';
|
2015-11-20 11:31:40 +01:00
|
|
|
/* global MF */
|
2014-10-30 21:44:22 +01:00
|
|
|
|
2014-07-06 17:37:54 +02:00
|
|
|
export default DS.Model.extend({
|
2015-08-23 06:18:35 +02:00
|
|
|
/*
|
|
|
|
* relationship
|
|
|
|
*/
|
2016-01-28 23:48:14 +01:00
|
|
|
poll: DS.belongsTo('poll'),
|
2015-11-12 15:52:14 +01:00
|
|
|
|
2015-08-23 06:18:35 +02:00
|
|
|
/*
|
|
|
|
* properties
|
|
|
|
*/
|
|
|
|
// ISO 8601 date + time string
|
2016-01-28 23:48:14 +01:00
|
|
|
creationDate: DS.attr('date'),
|
2015-08-23 06:18:35 +02:00
|
|
|
|
|
|
|
// user name
|
2016-01-28 23:48:14 +01:00
|
|
|
name: DS.attr('string'),
|
2015-08-23 06:18:35 +02:00
|
|
|
|
|
|
|
// array of users selections
|
|
|
|
// must be in same order as options property of poll
|
2016-01-28 23:48:14 +01:00
|
|
|
selections: MF.fragmentArray('selection'),
|
2015-08-23 06:18:35 +02:00
|
|
|
|
|
|
|
// Croodle version user got created with
|
2016-01-28 23:48:14 +01:00
|
|
|
version: DS.attr('string', {
|
2015-08-23 06:18:35 +02:00
|
|
|
encrypted: false
|
|
|
|
})
|
2015-06-20 19:04:19 +02:00
|
|
|
});
|