Class: Decidim::ActionDelegator::OrganizationDelegations

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

Instance Method Summary collapse

Constructor Details

#initialize(organization) ⇒ OrganizationDelegations

Returns a new instance of OrganizationDelegations.



6
7
8
# File 'app/queries/decidim/action_delegator/organization_delegations.rb', line 6

def initialize(organization)
  @organization = organization
end

Instance Method Details

#queryObject



10
11
12
13
14
15
# File 'app/queries/decidim/action_delegator/organization_delegations.rb', line 10

def query
  Delegation
    .joins(setting: :consultation)
    .merge(organization_consultations)
    .includes(:grantee, :granter)
end