添加日志

This commit is contained in:
huang 2017-05-05 20:57:18 +08:00
parent 66640b5a14
commit da19d8a7fd
2 changed files with 18 additions and 0 deletions

View File

@ -251,11 +251,14 @@ class GamesController < ApplicationController
@answer = challenge.answer
if @game.answer_open
@viewed = 1
logger.info("1 is #{@viewed}")
else
if @score >= 0
@viewed = 2
logger.info("2 is #{@viewed}")
else
@viewed = 3
logger.info("3 is #{@viewed}")
end
end
respond_to do |format|

View File

@ -0,0 +1,15 @@
class SyncIsPublicToGame < ActiveRecord::Migration
def change
# outputs = Output.all
# outputs.each do |output|
# puts("##{output}")
# challenge = output.game.try(:challenge)
# puts ("challenge id is #{challenge.id unless challenge.blank?}")
# unless challenge.blank?
# test_set = TestSet.where(:challenge_id => challenge.id, :position => output.test_set_position).first
# puts ("#{test_set.id unless test_set.blank?}")
# output.update_column(:is_public, test_set.is_public) unless test_set.blank?
# end
# end
end
end