实训关卡得分默认值设置为100分,并迁移以往分数为空的数据

This commit is contained in:
daiao 2017-09-22 20:05:48 +08:00
parent 236da38444
commit 0e253c4e9f
2 changed files with 11 additions and 1 deletions

View File

@ -15,7 +15,7 @@ unless RUBY_PLATFORM =~ /w32/
gem 'nokogiri' gem 'nokogiri'
end end
gem 'simple_xlsx_reader' #gem 'simple_xlsx_reader'
gem 'wechat',path: 'lib/wechat' gem 'wechat',path: 'lib/wechat'
gem 'grack', path:'lib/grack' gem 'grack', path:'lib/grack'
gem 'gitlab', path: 'lib/gitlab-cli' gem 'gitlab', path: 'lib/gitlab-cli'

View File

@ -0,0 +1,10 @@
class AddScoreDefaultValueForChallenge < ActiveRecord::Migration
def up
challenges = Challenge.where(:score => nil)
challenges.update_all(:score => 100)
change_column :challenges, :score, :integer, :default => 100
end
def down
end
end