Class: Decidim::Proposals::ProposalVote

Inherits:
ApplicationRecord show all
Defined in:
decidim-proposals/app/models/decidim/proposals/proposal_vote.rb

Overview

A proposal can include a vote per user.

Class Method Summary collapse

Class Method Details

.finalObject

Final votes are votes that will be taken into account, that is, they are not temporary.



26
27
28
# File 'decidim-proposals/app/models/decidim/proposals/proposal_vote.rb', line 26

def self.final
  where(temporary: false)
end

.temporaryObject

Temporary votes are used when a minimum amount of votes is configured in a component. They are not taken into account unless the amount of votes exceeds a threshold - meanwhile, they are marked as temporary.



20
21
22
# File 'decidim-proposals/app/models/decidim/proposals/proposal_vote.rb', line 20

def self.temporary
  where(temporary: true)
end