Assign groups to investments

This commit is contained in:
rgarcia
2018-02-08 22:26:02 +01:00
parent 1dbbe331c9
commit ab498d6d93
10 changed files with 78 additions and 11 deletions

View File

@@ -35,6 +35,9 @@ class Budget
has_many :valuator_assignments, dependent: :destroy
has_many :valuators, through: :valuator_assignments
has_many :valuator_group_assignments, dependent: :destroy
has_many :valuator_groups, through: :valuator_group_assignments
has_many :comments, -> {where(valuation: false)}, as: :commentable, class_name: 'Comment'
has_many :valuations, -> {where(valuation: true)}, as: :commentable, class_name: 'Comment'

View File

@@ -0,0 +1,6 @@
class Budget
class ValuatorGroupAssignment < ActiveRecord::Base
belongs_to :valuator_group
belongs_to :investment
end
end