Class: Decidim::ActionDelegator::DelegatesVotesByQuestion
- Inherits:
-
Query
- Object
- Query
- Decidim::ActionDelegator::DelegatesVotesByQuestion
- Defined in:
- app/queries/decidim/action_delegator/delegates_votes_by_question.rb
Instance Method Summary collapse
-
#initialize(question) ⇒ DelegatesVotesByQuestion
constructor
A new instance of DelegatesVotesByQuestion.
- #query ⇒ Object
Constructor Details
#initialize(question) ⇒ DelegatesVotesByQuestion
Returns a new instance of DelegatesVotesByQuestion.
6 7 8 |
# File 'app/queries/decidim/action_delegator/delegates_votes_by_question.rb', line 6 def initialize(question) @question = question end |
Instance Method Details
#query ⇒ Object
10 11 12 13 14 15 |
# File 'app/queries/decidim/action_delegator/delegates_votes_by_question.rb', line 10 def query DelegationVotes.new.query .merge(question.votes) .merge(consultation_delegations) .distinct.count(:granter_id) end |