Class: Decidim::Elections::Trustees::ByParticipatorySpaceTrusteeIds
- Inherits:
-
Query
- Object
- Query
- Decidim::Elections::Trustees::ByParticipatorySpaceTrusteeIds
- Defined in:
- app/queries/decidim/elections/trustees/by_participatory_space_trustee_ids.rb
Overview
A class used to find trustees by participatory space trustee ids.
Instance Method Summary collapse
-
#initialize(trustee_ids) ⇒ ByParticipatorySpaceTrusteeIds
constructor
Initializes the class.
-
#query ⇒ Object
Gets trustees by participatory space trustee ids.
Constructor Details
#initialize(trustee_ids) ⇒ ByParticipatorySpaceTrusteeIds
Initializes the class.
10 11 12 |
# File 'app/queries/decidim/elections/trustees/by_participatory_space_trustee_ids.rb', line 10 def initialize(trustee_ids) @trustee_ids = trustee_ids end |
Instance Method Details
#query ⇒ Object
Gets trustees by participatory space trustee ids.
15 16 17 18 19 20 |
# File 'app/queries/decidim/elections/trustees/by_participatory_space_trustee_ids.rb', line 15 def query Decidim::Elections::Trustee .includes([:user]) .joins(:trustees_participatory_spaces) .merge(Decidim::Elections::TrusteesParticipatorySpace.where(decidim_elections_trustee_id: @trustee_ids, considered: true)) end |