Commit e8c93b5f4bd3b3eef63ca95abb6596e1b1f611ce
1 parent
be9074f5
Exists in
master
and in
9 other branches
Include proposal hits in api
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
lib/proposals_discussion_plugin/api.rb
... | ... | @@ -8,7 +8,7 @@ class ProposalsDiscussionPlugin::API < Grape::API |
8 | 8 | effective_support = (proposal.votes_for - proposal.votes_against)/proposal.hits.to_f |
9 | 9 | effective_participation = (proposal.votes_for + proposal.votes_against)/proposal.hits.to_f |
10 | 10 | |
11 | - {:id => proposal.id, :abstract => proposal.abstract, :votes_for => proposal.votes_for, :votes_against => proposal.votes_against, :effective_support => effective_support, :effective_participation => effective_participation} | |
11 | + {:id => proposal.id, :abstract => proposal.abstract, :votes_for => proposal.votes_for, :votes_against => proposal.votes_against, :hits => proposal.hits, :effective_support => effective_support, :effective_participation => effective_participation} | |
12 | 12 | end |
13 | 13 | |
14 | 14 | proposals = proposals.sort_by { |p| p[:effective_support] }.reverse | ... | ... |