Class: Decidim::Budgets::BudgetsType

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

Instance Method Summary collapse

Instance Method Details

#budget(**args) ⇒ Object


21
22
23
# File 'decidim-budgets/lib/decidim/api/budgets_type.rb', line 21

def budget(**args)
  Budget.where(component: object).find_by(id: args[:id])
end

#budgetsObject


13
14
15
# File 'decidim-budgets/lib/decidim/api/budgets_type.rb', line 13

def budgets
  Budget.where(component: object).includes(:component)
end