Fix volunteer counts shown for a team (#46)
Before this change the count of volunteers in a team was not in sync with the filters applied.  After the change:  BTW I feel that we will end up refactoring the relation at some point in the future. Reviewed-on: #46 Co-authored-by: Tocho Tochev <tocho@tochev.net> Co-committed-by: Tocho Tochev <tocho@tochev.net>
This commit is contained in:
parent
5ff505d246
commit
bcac28d4ff
@ -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}
|
||||
|
Loading…
x
Reference in New Issue
Block a user