From 134e833a479e936431728354f7e6cd09c829b88b Mon Sep 17 00:00:00 2001 From: Tocho Tochev Date: Sat, 18 May 2024 15:59:57 +0300 Subject: [PATCH] Fix volunteer counts shown for a team --- app/models/volunteer_team.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/volunteer_team.rb b/app/models/volunteer_team.rb index 4105cee..bc3e776 100644 --- a/app/models/volunteer_team.rb +++ b/app/models/volunteer_team.rb @@ -1,6 +1,7 @@ class VolunteerTeam < ActiveRecord::Base belongs_to :conference - has_and_belongs_to_many :volunteers + has_many :volunteers, inverse_of: :volunteer_team + has_and_belongs_to_many :supporters, class_name: "Volunteer", inverse_of: :additional_volunteer_teams validates :name, presence: true validates :color, presence: true, format: {with: /\A#?[a-f0-9]{6}\z/i} -- 2.40.1