Merge branch 'legislation-module-stable' into 42-integrate-admin-html-css

This commit is contained in:
Amaia Castro
2017-01-02 18:03:55 +01:00
11 changed files with 26 additions and 15 deletions

View File

@@ -50,7 +50,7 @@ class Proposal < ActiveRecord::Base
scope :last_week, -> { where("proposals.created_at >= ?", 7.days.ago)}
scope :retired, -> { where.not(retired_at: nil) }
scope :not_retired, -> { where(retired_at: nil) }
scope :successfull, -> { where("cached_votes_up + physical_votes >= ?", Proposal.votes_needed_for_success)}
scope :successfull, -> { where("cached_votes_up >= ?", Proposal.votes_needed_for_success)}
def to_param
"#{id}-#{title}".parameterize
@@ -99,7 +99,7 @@ class Proposal < ActiveRecord::Base
end
def total_votes
cached_votes_up + physical_votes
cached_votes_up
end
def voters