Description:
Merge branch 'master' into codejom (user stat reset)
Conflicts:
app/models/user.rb
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r248:0f32f3dd1054 - - 2 files changed: 9 inserted, 1 deleted
@@ -17,6 +17,14 | |||
|
17 | 17 | end |
|
18 | 18 | end |
|
19 | 19 | |
|
20 | + def clear_stat | |
|
21 | + user = User.find(params[:id]) | |
|
22 | + if user.contest_stat!=nil | |
|
23 | + user.contest_stat.destroy | |
|
24 | + end | |
|
25 | + redirect_to :action => 'user_stat' | |
|
26 | + end | |
|
27 | + | |
|
20 | 28 | def clear_all_stat |
|
21 | 29 | if not Configuration.indv_contest_mode? |
|
22 | 30 | redirect_to :action => 'index' and return |
@@ -20,7 +20,7 | |||
|
20 | 20 | has_many :test_pair_assignments, :dependent => :delete_all |
|
21 | 21 | has_many :submission_statuses |
|
22 | 22 | |
|
23 | - has_one :contest_stat, :class_name => "UserContestStat" | |
|
23 | + has_one :contest_stat, :class_name => "UserContestStat", :dependent => :destroy | |
|
24 | 24 | |
|
25 | 25 | belongs_to :site |
|
26 | 26 | belongs_to :country |
You need to be logged in to leave comments.
Login now