|
|
@ -3,7 +3,7 @@ class ChallengeAnswer < ApplicationRecord
|
|
|
|
belongs_to :challenge
|
|
|
|
belongs_to :challenge
|
|
|
|
has_many :game_answers, :dependent => :destroy
|
|
|
|
has_many :game_answers, :dependent => :destroy
|
|
|
|
|
|
|
|
|
|
|
|
validates :contents, length: { maximum: 5000 , too_long: "不能超过25000个字符"}
|
|
|
|
validates :contents, length: { maximum: 25000 , too_long: "不能超过25000个字符"}
|
|
|
|
|
|
|
|
|
|
|
|
def view_answer_time(user_id)
|
|
|
|
def view_answer_time(user_id)
|
|
|
|
game_answers.where(user_id: user_id).last&.view_time
|
|
|
|
game_answers.where(user_id: user_id).last&.view_time
|
|
|
|