ファイル
btrc-hub/backend/app/models/gekanator_game.rb
T
2026-06-08 08:45:52 +09:00

10 行
321 B
Ruby

class GekanatorGame < ApplicationRecord
belongs_to :user
belongs_to :guessed_post, class_name: 'Post'
belongs_to :correct_post, class_name: 'Post'
validates :answers, presence: true
validates :question_count, numericality: { greater_than_or_equal_to: 0 }
validates :won, inclusion: { in: [true, false] }
end