Fix volunteer counts shown for a team

This commit is contained in:
Tocho Tochev 2024-05-18 15:59:57 +03:00
parent 2180b0ea9f
commit 134e833a47
1 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,7 @@
class VolunteerTeam < ActiveRecord::Base class VolunteerTeam < ActiveRecord::Base
belongs_to :conference 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 :name, presence: true
validates :color, presence: true, format: {with: /\A#?[a-f0-9]{6}\z/i} validates :color, presence: true, format: {with: /\A#?[a-f0-9]{6}\z/i}