Class: Decidim::Budgets::LineItem

Inherits:
ApplicationRecord show all
Defined in:
decidim-budgets/app/models/decidim/budgets/line_item.rb

Overview

The data store for a LineItem in the Budget resource. It describes an association between an order and a project.

Instance Method Summary collapse

Instance Method Details

#same_budgetObject



14
15
16
17
18
# File 'decidim-budgets/app/models/decidim/budgets/line_item.rb', line 14

def same_budget
  return unless order && project

  errors.add(:order, :invalid) unless order.budget == project.budget
end