diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index cc930f7b1..da753a053 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -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| diff --git a/db/migrate/20170505085001_sync_is_public_to_game.rb b/db/migrate/20170505085001_sync_is_public_to_game.rb new file mode 100644 index 000000000..e2dc50392 --- /dev/null +++ b/db/migrate/20170505085001_sync_is_public_to_game.rb @@ -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