Skip to content

Commit

Permalink
Only list unique elements in dropdowns on the repository page
Browse files Browse the repository at this point in the history
  • Loading branch information
jorg-vr committed Jan 20, 2023
1 parent bc892fd commit b689e69
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/models/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b689e69

Please sign in to comment.