add column full_score_reached, fill it accordingly and show information in the rfc index

This commit is contained in:
Ralf Teusner
2018-01-31 11:23:30 +01:00
parent e934a29a45
commit efc271c4ed
6 changed files with 37 additions and 10 deletions

View File

@ -0,0 +1,15 @@
class AddReachedFullScoreToRequestForComment < ActiveRecord::Migration
def up
add_column :request_for_comments, :full_score_reached, :boolean, default: false
RequestForComment.all.each { |rfc|
if (rfc.submission.exercise.has_user_solved(rfc.user))
rfc.full_score_reached = true
rfc.save
end
}
end
def down
remove_column :request_for_comments, :full_score_reached
end
end