|
1 | 1 | export default DS.Model.extend({
|
| 2 | + // relationship |
| 3 | + users : DS.hasMany('user'), |
| 4 | + |
| 5 | + // properties |
2 | 6 | encryptedTitle : DS.attr('string'),
|
3 | 7 | title : Ember.computed.encrypted('encryptedTitle', 'string'),
|
| 8 | + |
4 | 9 | encryptedDescription : DS.attr('string'),
|
5 | 10 | description: Ember.computed.encrypted('encryptedDescription', 'string'),
|
| 11 | + |
6 | 12 | encryptedPollType : DS.attr('string'),
|
7 | 13 | pollType : Ember.computed.encrypted('encryptedPollType', 'string'),
|
| 14 | + |
8 | 15 | encryptedAnswerType: DS.attr('string'),
|
9 | 16 | answerType : Ember.computed.encrypted('encryptedAnswerType', 'string'),
|
| 17 | + |
10 | 18 | encryptedAnswers : DS.attr('string'),
|
11 | 19 | answers : Ember.computed.encrypted('encryptedAnswers', 'array'),
|
| 20 | + |
12 | 21 | encryptedOptions : DS.attr('string'),
|
13 | 22 | options : Ember.computed.encrypted('encryptedOptions', 'array'),
|
14 |
| - users : DS.hasMany('user', {async: true}), |
| 23 | + |
15 | 24 | encryptedCreationDate : DS.attr('string'),
|
16 | 25 | creationDate : Ember.computed.encrypted('encryptedCreationDate', 'date'),
|
| 26 | + |
17 | 27 | encryptedForceAnswer : DS.attr('string'),
|
18 | 28 | forceAnswer : Ember.computed.encrypted('encryptedForceAnswer', 'boolean'),
|
| 29 | + |
19 | 30 | encryptedAnonymousUser : DS.attr('string'),
|
20 | 31 | anonymousUser : Ember.computed.encrypted('encryptedAnonymousUser', 'boolean'),
|
| 32 | + |
21 | 33 | encryptedIsDateTime : DS.attr('string'),
|
22 | 34 | isDateTime : Ember.computed.encrypted('encryptedIsDateTime', 'boolean'),
|
23 | 35 |
|
| 36 | + // computed properties |
24 | 37 | isFindADate: function() {
|
25 | 38 | return this.get('pollType') === 'FindADate';
|
26 | 39 | }.property('pollType'),
|
| 40 | + |
27 | 41 | isFreeText: function() {
|
28 | 42 | return this.get('answerType') === 'FreeText';
|
29 | 43 | }.property('answerType'),
|
| 44 | + |
30 | 45 | isMakeAPoll: function() {
|
31 | 46 | return this.get('pollType') === 'MakeAPoll';
|
32 | 47 | }.property('pollType')
|
|
0 commit comments