|
|
|
@ -121,7 +121,7 @@ class Game < ApplicationRecord
|
|
|
|
|
|
|
|
|
|
# 是否查看了答案(通关的是否在通关前看的答案)
|
|
|
|
|
def view_answer
|
|
|
|
|
answer_exists = Grade.exists?("container_type = 'Answer' and container_id = #{id} and created_at < '#{end_time}'")
|
|
|
|
|
answer_exists = Grade.where("container_type = 'Answer' and container_id = #{self.id} and created_at < '#{self.end_time}'").exists?
|
|
|
|
|
answer_open != 0 ? (status == 2 ? answer_exists : true) : false
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|