Class: Decidim::Elections::ElectionsType

Inherits:
Api::Types::BaseObject show all
Defined in:
decidim-elections/lib/decidim/api/elections_type.rb

Instance Method Summary collapse

Instance Method Details

#election(**args) ⇒ Object


21
22
23
# File 'decidim-elections/lib/decidim/api/elections_type.rb', line 21

def election(**args)
  ElectionsTypeHelper.base_scope(object).find_by(id: args[:id])
end

#electionsObject


13
14
15
# File 'decidim-elections/lib/decidim/api/elections_type.rb', line 13

def elections
  ElectionsTypeHelper.base_scope(object).includes(:component)
end