Class: Decidim::Debates::DebatesType

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

Instance Method Summary collapse

Instance Method Details

#debate(**args) ⇒ Object


21
22
23
# File 'decidim-debates/lib/decidim/api/debates_type.rb', line 21

def debate(**args)
  Debate.where(component: object).find_by(id: args[:id])
end

#debatesObject


13
14
15
# File 'decidim-debates/lib/decidim/api/debates_type.rb', line 13

def debates
  Debate.where(component: object).includes(:component)
end