diff --git a/app/models/repository.rb b/app/models/repository.rb index 5122fb3ec7..6a9abf7cbc 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -33,12 +33,15 @@ class Repository < ApplicationRecord belongs_to :judge has_many :activities, dependent: :restrict_with_error has_many :labels, + -> { distinct }, through: :activities, source: :labels has_many :programming_languages, + -> { distinct }, through: :activities, source: :programming_language has_many :judges, + -> { distinct }, through: :activities, source: :judge has_many :repository_admins, dependent: :restrict_with_error