Added cached_votes_total and cached_votes_down to Legislation Proposals
This commit is contained in:
@@ -80,10 +80,18 @@ class Legislation::Proposal < ActiveRecord::Base
|
||||
/\A#{Setting["proposal_code_prefix"]}-\d\d\d\d-\d\d-(\d*)\z/.match(terms)
|
||||
end
|
||||
|
||||
def total_votes
|
||||
def likes
|
||||
cached_votes_up
|
||||
end
|
||||
|
||||
def dislikes
|
||||
cached_votes_down
|
||||
end
|
||||
|
||||
def total_votes
|
||||
cached_votes_total
|
||||
end
|
||||
|
||||
def voters
|
||||
User.active.where(id: votes_for.voters)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user