REFACTOR: rename "total_votes" poll field to the more accurate "voters"

FEATURE: automagically load plugin's migrations
This commit is contained in:
Régis Hanol
2015-05-04 16:01:57 +02:00
parent 8f706f11cb
commit 86d7412f30
13 changed files with 58 additions and 39 deletions

View File

@ -13,7 +13,7 @@ export default Em.Controller.extend({
// - user wants to see the results
showingResults: Em.computed.or("isClosed", "post.topic.closed", "post.topic.archived", "showResults"),
showResultsDisabled: Em.computed.equal("poll.total_votes", 0),
showResultsDisabled: Em.computed.equal("poll.voters", 0),
hideResultsDisabled: Em.computed.alias("isClosed"),
poll: function() {
@ -37,10 +37,6 @@ export default Em.Controller.extend({
return _.map(this.get("poll.options").filterBy("selected"), o => o.get("id"));
}.property("poll.options.@each.selected"),
totalVotesText: function() {
return I18n.t("poll.total_votes", { count: this.get("poll.total_votes") });
}.property("poll.total_votes"),
min: function() {
let min = parseInt(this.get("poll.min"), 10);
if (isNaN(min) || min < 1) { min = 1; }