Class: Decidim::Debates::DebatesType

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

Instance Method Summary collapse

Instance Method Details

#debate(**args) ⇒ Object



21
22
23
# File '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 'lib/decidim/api/debates_type.rb', line 13

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