From 365faeff315b56c215eb1b0c1cf9ff77e38b7e52 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Thu, 29 Dec 2016 12:05:29 +0100 Subject: [PATCH] removes physical votes from proposals --- app/models/proposal.rb | 2 +- .../20161229110336_remove_physical_votes_from_proposals.rb | 5 +++++ spec/helpers/proposals_helper_spec.rb | 5 ----- 3 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 db/migrate/20161229110336_remove_physical_votes_from_proposals.rb diff --git a/app/models/proposal.rb b/app/models/proposal.rb index 7bd4b7a92..cba6d04ba 100644 --- a/app/models/proposal.rb +++ b/app/models/proposal.rb @@ -99,7 +99,7 @@ class Proposal < ActiveRecord::Base end def total_votes - cached_votes_up + physical_votes + cached_votes_up end def voters diff --git a/db/migrate/20161229110336_remove_physical_votes_from_proposals.rb b/db/migrate/20161229110336_remove_physical_votes_from_proposals.rb new file mode 100644 index 000000000..34e0e5e44 --- /dev/null +++ b/db/migrate/20161229110336_remove_physical_votes_from_proposals.rb @@ -0,0 +1,5 @@ +class RemovePhysicalVotesFromProposals < ActiveRecord::Migration + def change + remove_column :proposals, :physical_votes + end +end diff --git a/spec/helpers/proposals_helper_spec.rb b/spec/helpers/proposals_helper_spec.rb index 82206afb5..0f7c70b39 100644 --- a/spec/helpers/proposals_helper_spec.rb +++ b/spec/helpers/proposals_helper_spec.rb @@ -13,11 +13,6 @@ describe ProposalsHelper do expect(progress_bar_percentage(proposal)).to eq 50 end - it "should take into account the physical votes" do - proposal = create(:proposal, cached_votes_up: ((Proposal.votes_needed_for_success/2)-100), physical_votes: 100) - expect(progress_bar_percentage(proposal)).to eq 50 - end - it "should be 100 if there are more votes than needed" do proposal = create(:proposal, cached_votes_up: Proposal.votes_needed_for_success*2) expect(progress_bar_percentage(proposal)).to eq 100