Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models/contest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Contest < ActiveRecord::Base

has_many :group_associations, class_name: GroupContest, inverse_of: :contest, dependent: :destroy
has_many :groups, through: :group_associations
has_many :group_members, -> { uniq }, through: :groups, source: :users
has_many :group_members, -> { distinct }, through: :groups, source: :users

belongs_to :owner, class_name: :User

Expand Down
2 changes: 1 addition & 1 deletion app/models/problem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Problem < ActiveRecord::Base

has_many :contests, through: :problem_sets
has_many :contest_relations, through: :contests
has_many :groups, -> { uniq }, through: :problem_sets
has_many :groups, -> { distinct }, through: :problem_sets
has_many :group_memberships, through: :groups, source: :memberships

has_many :filelinks, -> { includes(:file_attachment) }, as: :root, dependent: :destroy
Expand Down
2 changes: 1 addition & 1 deletion app/models/problem_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class ProblemSet < ActiveRecord::Base
has_many :problems, through: :problem_associations
has_many :group_associations, class_name: GroupProblemSet, inverse_of: :problem_set, dependent: :destroy
has_many :groups, through: :group_associations
has_many :group_memberships, -> { uniq }, through: :groups, source: :memberships
has_many :group_memberships, -> { distinct }, through: :groups, source: :memberships

has_many :contests
has_many :contest_relations, through: :contests, source: :contest_relations
Expand Down
Loading