Class: Decidim::Budgets::LineItem

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

Overview

The data store for a LineItem in the Decidim::Budgets component. It describes an association between an order and a project.

Instance Method Summary collapse

Instance Method Details

#same_componentObject



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

def same_component
  return unless order && project
  errors.add(:order, :invalid) unless order.component == project.component
end