decide.nolog.cz/app/models/user.js
2023-10-15 20:37:03 +02:00

34 lines
658 B
JavaScript

import classic from 'ember-classic-decorator';
import Model, { belongsTo, attr } from '@ember-data/model';
import { fragmentArray } from 'ember-data-model-fragments/attributes';
@classic
export default class User extends Model {
/*
* relationship
*/
@belongsTo('poll')
poll;
/*
* properties
*/
// ISO 8601 date + time string
@attr('date')
creationDate;
// user name
@attr('string')
name;
// array of users selections
// must be in same order as options property of poll
@fragmentArray('selection')
selections;
// Croodle version user got created with
@attr('string', {
encrypted: false,
})
version;
}