Class: Decidim::Debates::DebatesType

Inherits:
Core::ComponentType
  • Object
show all
Defined in:
lib/decidim/api/debates_type.rb

Instance Method Summary collapse

Instance Method Details

#debate(**args) ⇒ Object



18
19
20
# File 'lib/decidim/api/debates_type.rb', line 18

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

#debatesObject



14
15
16
# File 'lib/decidim/api/debates_type.rb', line 14

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