Class: Decidim::ActionDelegator::DelegationVotes

Inherits:
Query
  • Object
show all
Defined in:
app/queries/decidim/action_delegator/delegation_votes.rb

Overview

This query object replaces the ActiveRecord association we would have between the Vote and Delegation models. Unfortunately we can’t use custom foreign keys on both ends of the association so this aims to replace ‘delegation.votes`.

Instance Method Summary collapse

Instance Method Details

#queryObject



9
10
11
12
13
# File 'app/queries/decidim/action_delegator/delegation_votes.rb', line 9

def query
  Delegation.joins(
    delegations.join(votes).on(vote_author_eq_granter).join_sources
  )
end