2020-01-18 10:13:50 +01:00
|
|
|
import classic from 'ember-classic-decorator';
|
2020-01-08 15:58:52 +01:00
|
|
|
import Model, { belongsTo, attr } from '@ember-data/model';
|
2016-08-12 19:19:19 +02:00
|
|
|
import {
|
|
|
|
fragmentArray
|
2017-07-30 18:19:17 +02:00
|
|
|
} from 'ember-data-model-fragments/attributes';
|
2014-10-30 21:44:22 +01:00
|
|
|
|
2020-01-18 10:13:50 +01:00
|
|
|
@classic
|
|
|
|
export default class User extends Model {
|
2015-08-23 06:18:35 +02:00
|
|
|
/*
|
|
|
|
* relationship
|
|
|
|
*/
|
2020-01-18 10:13:50 +01:00
|
|
|
@belongsTo('poll')
|
|
|
|
poll;
|
2015-11-12 15:52:14 +01:00
|
|
|
|
2015-08-23 06:18:35 +02:00
|
|
|
/*
|
|
|
|
* properties
|
|
|
|
*/
|
|
|
|
// ISO 8601 date + time string
|
2020-01-18 10:13:50 +01:00
|
|
|
@attr('date')
|
|
|
|
creationDate;
|
2015-08-23 06:18:35 +02:00
|
|
|
|
|
|
|
// user name
|
2020-01-18 10:13:50 +01:00
|
|
|
@attr('string')
|
|
|
|
name;
|
2015-08-23 06:18:35 +02:00
|
|
|
|
|
|
|
// array of users selections
|
|
|
|
// must be in same order as options property of poll
|
2020-01-18 10:13:50 +01:00
|
|
|
@fragmentArray('selection')
|
|
|
|
selections;
|
2015-08-23 06:18:35 +02:00
|
|
|
|
|
|
|
// Croodle version user got created with
|
2020-01-18 10:13:50 +01:00
|
|
|
@attr('string', {
|
2015-08-23 06:18:35 +02:00
|
|
|
encrypted: false
|
|
|
|
})
|
2020-01-18 10:13:50 +01:00
|
|
|
version;
|
|
|
|
}
|