ファイル
btrc-hub/backend/app/models/gekanator_question_suggestion.rb
T
2026-06-16 00:34:48 +09:00

13 行
473 B
Ruby

class GekanatorQuestionSuggestion < ApplicationRecord
ANSWERS = ['yes', 'no', 'partial', 'probably_no', 'unknown'].freeze
belongs_to :gekanator_game
belongs_to :user
has_many :gekanator_questions, dependent: :nullify
has_many :gekanator_ai_runs, dependent: :destroy
validates :question_text, presence: true, length: { maximum: 1000 }
validates :answer, presence: true, inclusion: { in: ANSWERS }
validates :processed, inclusion: { in: [true, false] }
end