Description:
fix migration to work with rails 4 and ruby 2.3
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r666:0327c11ce255 - - 8 files changed: 9 inserted, 10 deleted
@@ -3,7 +3,7 | |||
|
3 | 3 | add_column :languages, :ext, :string, :limit => 10 |
|
4 | 4 | |
|
5 | 5 | Language.reset_column_information |
|
6 |
- langs = Language. |
|
|
6 | + langs = Language.all | |
|
7 | 7 | langs.each do |l| |
|
8 | 8 | l.ext = l.name |
|
9 | 9 | l.save |
@@ -4,7 +4,7 | |||
|
4 | 4 | add_column :tasks, :updated_at, :datetime |
|
5 | 5 | |
|
6 | 6 | Task.reset_column_information |
|
7 |
- Task. |
|
|
7 | + Task.all.each do |task| | |
|
8 | 8 | task.status_complete |
|
9 | 9 | task.save |
|
10 | 10 | end |
@@ -9,8 +9,7 | |||
|
9 | 9 | last_problem_id = nil |
|
10 | 10 | current_number = 0 |
|
11 | 11 | |
|
12 | - Submission.find(:all, | |
|
13 | - :order => 'user_id, problem_id, submitted_at').each do |submission| | |
|
12 | + Submission.order('user_id, problem_id, submitted_at').each do |submission| | |
|
14 | 13 | if submission.user_id==last_user_id and submission.problem_id==last_problem_id |
|
15 | 14 | current_number += 1 |
|
16 | 15 | else |
@@ -7,7 +7,7 | |||
|
7 | 7 | add_column :users, :site_id, :integer |
|
8 | 8 | User.reset_column_information |
|
9 | 9 | |
|
10 |
- User. |
|
|
10 | + User.all.each do |user| | |
|
11 | 11 | |
|
12 | 12 | class << user |
|
13 | 13 | def valid? |
@@ -3,7 +3,7 | |||
|
3 | 3 | add_column :problems, :description_id, :integer |
|
4 | 4 | Problem.reset_column_information |
|
5 | 5 | |
|
6 |
- Problem. |
|
|
6 | + Problem.all.each do |problem| | |
|
7 | 7 | if problem.body!=nil |
|
8 | 8 | description = Description.new |
|
9 | 9 | description.body = problem.body |
@@ -21,7 +21,7 | |||
|
21 | 21 | add_column :problems, :body, :text |
|
22 | 22 | Problem.reset_column_information |
|
23 | 23 | |
|
24 |
- Problem. |
|
|
24 | + Problem.all.each do |problem| | |
|
25 | 25 | if problem.description_id != nil |
|
26 | 26 | problem.body = Description.find(problem.description_id).body |
|
27 | 27 | problem.save |
@@ -3,7 +3,7 | |||
|
3 | 3 | add_column :problems, :test_allowed, :boolean |
|
4 | 4 | Problem.reset_column_information |
|
5 | 5 | |
|
6 |
- Problem. |
|
|
6 | + Problem.all.each do |problem| | |
|
7 | 7 | problem.test_allowed = true |
|
8 | 8 | problem.save |
|
9 | 9 | end |
You need to be logged in to leave comments.
Login now