Class: Decidim::Votings::Admin::PollingOfficersJoinPollingStationsAndUser
- Inherits:
-
Query
- Object
- Query
- Decidim::Votings::Admin::PollingOfficersJoinPollingStationsAndUser
- Defined in:
- app/queries/decidim/votings/admin/polling_officers_join_polling_stations_and_user.rb
Overview
A class join the polling officers with their respective polling stations and users.
Class Method Summary collapse
-
.for(polling_officers) ⇒ Object
Syntactic sugar to initialize the class and return the queried objects.
Instance Method Summary collapse
-
#initialize(polling_officers) ⇒ PollingOfficersJoinPollingStationsAndUser
constructor
Initializes the class.
-
#query ⇒ Object
Finds joins the polling officers with their associated polling stations and users.
Constructor Details
#initialize(polling_officers) ⇒ PollingOfficersJoinPollingStationsAndUser
Initializes the class.
polling_officers - the collection of polling officers
18 19 20 |
# File 'app/queries/decidim/votings/admin/polling_officers_join_polling_stations_and_user.rb', line 18 def initialize(polling_officers) @polling_officers = polling_officers end |
Class Method Details
.for(polling_officers) ⇒ Object
Syntactic sugar to initialize the class and return the queried objects.
polling_officers - the collection of polling officers
11 12 13 |
# File 'app/queries/decidim/votings/admin/polling_officers_join_polling_stations_and_user.rb', line 11 def self.for(polling_officers) new(polling_officers).query end |
Instance Method Details
#query ⇒ Object
Finds joins the polling officers with their associated polling stations and users.
Returns an ActiveRecord::Relation.
25 26 27 28 29 30 |
# File 'app/queries/decidim/votings/admin/polling_officers_join_polling_stations_and_user.rb', line 25 def query Decidim::Query.merge( PollingOfficersJoinPollingStations.new(@polling_officers), PollingOfficersJoinUser.new(@polling_officers) ).query end |