Merge remote-tracking branch 'origin/develop' into guange_dev
This commit is contained in:
commit
050d3c5440
|
@ -1,5 +1,6 @@
|
|||
class UpdateOneStudentScore < ActiveRecord::Migration
|
||||
def up
|
||||
begin
|
||||
student_work_score = StudentWorksScore.where("user_id = 11688 AND student_work_id = 34414").first
|
||||
student_work_score.score = 100
|
||||
student_work_score.save
|
||||
|
@ -31,6 +32,9 @@ class UpdateOneStudentScore < ActiveRecord::Migration
|
|||
end
|
||||
work.save
|
||||
end
|
||||
rescue => e
|
||||
logger.error "[Errno::ENOENT] ===> #{e}"
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
class UpdateOneStudentTeacherScore < ActiveRecord::Migration
|
||||
def up
|
||||
begin
|
||||
work = StudentWork.find 49774
|
||||
score = StudentWorksScore.new
|
||||
score.score = 100
|
||||
|
@ -10,6 +11,9 @@ class UpdateOneStudentTeacherScore < ActiveRecord::Migration
|
|||
work.teacher_score = score.score
|
||||
end
|
||||
work.save
|
||||
rescue => e
|
||||
logger.error "[Errno::ENOENT] ===> #{e}"
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
class DeleteAnonymousWork < ActiveRecord::Migration
|
||||
def up
|
||||
begin
|
||||
student_works = StudentWork.where("homework_common_id = 2882").map{|work| work.id} unless StudentWork.where("homework_common_id = 2882").empty?
|
||||
student_work_ids = "(" + student_works.join(",") + ")"
|
||||
student_work_scores = StudentWorksScore.where("student_work_id in #{student_work_ids}")
|
||||
|
@ -12,6 +13,9 @@ class DeleteAnonymousWork < ActiveRecord::Migration
|
|||
student_work.save
|
||||
end
|
||||
end
|
||||
rescue => e
|
||||
logger.error "[Errno::ENOENT] ===> #{e}"
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
|
|
Loading…
Reference in New Issue