Sha256: 7780fc4e1b954a90d9d048a40bc4cdbd3f61b69e2834032e5b41b75d31376cdb
Contents?: true
Size: 996 Bytes
Versions: 25
Compression:
Stored size: 996 Bytes
Contents
# frozen_string_literal: true module Decidim module Votings module Admin # A class join the polling officers with their respective decidim user. class PollingOfficersJoinUser < Rectify::Query # Syntactic sugar to initialize the class and return the queried objects. # # polling_officers - the collection of polling officers def self.for(polling_officers) new(polling_officers).query end # Initializes the class. # # polling_officers - the collection of polling officers def initialize(polling_officers) @polling_officers = polling_officers end # Joins the polling officers with their associated decidim user. # # Returns an ActiveRecord::Relation. def query @polling_officers .joins("LEFT JOIN decidim_users ON decidim_users.id = decidim_votings_polling_officers.decidim_user_id") end end end end end
Version data entries
25 entries across 25 versions & 1 rubygems