2014-07-06 17:37:54 +02:00
|
|
|
export default DS.Model.extend({
|
2014-09-28 14:55:40 +02:00
|
|
|
// relationship
|
|
|
|
users : DS.hasMany('user'),
|
|
|
|
|
|
|
|
// properties
|
2014-07-06 17:37:54 +02:00
|
|
|
encryptedTitle : DS.attr('string'),
|
|
|
|
title : Ember.computed.encrypted('encryptedTitle', 'string'),
|
2014-09-28 14:55:40 +02:00
|
|
|
|
2014-07-06 17:37:54 +02:00
|
|
|
encryptedDescription : DS.attr('string'),
|
|
|
|
description: Ember.computed.encrypted('encryptedDescription', 'string'),
|
2014-09-28 14:55:40 +02:00
|
|
|
|
2014-07-06 17:37:54 +02:00
|
|
|
encryptedPollType : DS.attr('string'),
|
|
|
|
pollType : Ember.computed.encrypted('encryptedPollType', 'string'),
|
2014-09-28 14:55:40 +02:00
|
|
|
|
2014-07-06 17:37:54 +02:00
|
|
|
encryptedAnswerType: DS.attr('string'),
|
|
|
|
answerType : Ember.computed.encrypted('encryptedAnswerType', 'string'),
|
2014-09-28 14:55:40 +02:00
|
|
|
|
2014-07-06 17:37:54 +02:00
|
|
|
encryptedAnswers : DS.attr('string'),
|
|
|
|
answers : Ember.computed.encrypted('encryptedAnswers', 'array'),
|
2014-09-28 14:55:40 +02:00
|
|
|
|
2014-07-06 17:37:54 +02:00
|
|
|
encryptedOptions : DS.attr('string'),
|
|
|
|
options : Ember.computed.encrypted('encryptedOptions', 'array'),
|
2014-09-28 14:55:40 +02:00
|
|
|
|
2014-07-06 17:37:54 +02:00
|
|
|
encryptedCreationDate : DS.attr('string'),
|
|
|
|
creationDate : Ember.computed.encrypted('encryptedCreationDate', 'date'),
|
2014-09-28 14:55:40 +02:00
|
|
|
|
2014-07-06 17:37:54 +02:00
|
|
|
encryptedForceAnswer : DS.attr('string'),
|
|
|
|
forceAnswer : Ember.computed.encrypted('encryptedForceAnswer', 'boolean'),
|
2014-09-28 14:55:40 +02:00
|
|
|
|
2014-07-06 17:37:54 +02:00
|
|
|
encryptedAnonymousUser : DS.attr('string'),
|
|
|
|
anonymousUser : Ember.computed.encrypted('encryptedAnonymousUser', 'boolean'),
|
2014-09-28 14:55:40 +02:00
|
|
|
|
2014-07-07 01:51:58 +02:00
|
|
|
encryptedIsDateTime : DS.attr('string'),
|
|
|
|
isDateTime : Ember.computed.encrypted('encryptedIsDateTime', 'boolean'),
|
2014-07-06 17:37:54 +02:00
|
|
|
|
2014-10-28 03:27:54 +01:00
|
|
|
encryptedTimezoneOffset : DS.attr('string'),
|
|
|
|
timezoneOffset : Ember.computed.encrypted('encryptedTimezoneOffset', 'number'),
|
|
|
|
|
2014-09-28 14:55:40 +02:00
|
|
|
// computed properties
|
2014-07-06 17:37:54 +02:00
|
|
|
isFindADate: function() {
|
|
|
|
return this.get('pollType') === 'FindADate';
|
|
|
|
}.property('pollType'),
|
2014-09-28 14:55:40 +02:00
|
|
|
|
2014-07-06 17:37:54 +02:00
|
|
|
isFreeText: function() {
|
|
|
|
return this.get('answerType') === 'FreeText';
|
|
|
|
}.property('answerType'),
|
2014-09-28 14:55:40 +02:00
|
|
|
|
2014-07-06 17:37:54 +02:00
|
|
|
isMakeAPoll: function() {
|
|
|
|
return this.get('pollType') === 'MakeAPoll';
|
|
|
|
}.property('pollType')
|
|
|
|
});
|