Skip to content

Commit

Permalink
Merge pull request #4338 from dodona-edu/fix/repository-dropdown-dupl…
Browse files Browse the repository at this point in the history
…icates

Only list unique elements in dropdowns on the repository page
  • Loading branch information
jorg-vr authored Jan 20, 2023
2 parents b549e4f + b689e69 commit 0f9cf74
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 0f9cf74

Please sign in to comment.