Description:
shows only enabled contests, ordered by name
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r285:011d92099790 - - 3 files changed: 4 inserted, 2 deleted
@@ -196,7 +196,7 | |||||
|
196 | def problem_list_by_user_contests(user) |
|
196 | def problem_list_by_user_contests(user) |
|
197 | contest_problems = [] |
|
197 | contest_problems = [] |
|
198 | pin = {} |
|
198 | pin = {} |
|
199 | - user.contests.each do |contest| |
|
199 | + user.contests.enabled.each do |contest| |
|
200 | available_problems = contest.problems.available |
|
200 | available_problems = contest.problems.available |
|
201 | contest_problems << { |
|
201 | contest_problems << { |
|
202 | :contest => contest, |
|
202 | :contest => contest, |
@@ -3,4 +3,6 | |||||
|
3 | has_and_belongs_to_many :users |
|
3 | has_and_belongs_to_many :users |
|
4 | has_and_belongs_to_many :problems |
|
4 | has_and_belongs_to_many :problems |
|
5 |
|
5 | ||
|
|
6 | + named_scope :enabled, :conditions => {:enabled => true} | ||
|
|
7 | + | ||
|
6 | end |
|
8 | end |
@@ -21,7 +21,7 | |||||
|
21 | belongs_to :site |
|
21 | belongs_to :site |
|
22 | belongs_to :country |
|
22 | belongs_to :country |
|
23 |
|
23 | ||
|
24 | - has_and_belongs_to_many :contests, :uniq => true |
|
24 | + has_and_belongs_to_many :contests, :uniq => true, :order => 'name' |
|
25 |
|
25 | ||
|
26 | named_scope :activated_users, :conditions => {:activated => true} |
|
26 | named_scope :activated_users, :conditions => {:activated => true} |
|
27 |
|
27 |
You need to be logged in to leave comments.
Login now