37ade2a988
Reviewed-on: #362 Co-authored-by: miteruzo <miteruzo@naver.com> Co-committed-by: miteruzo <miteruzo@naver.com>
16 行
559 B
Ruby
16 行
559 B
Ruby
class GekanatorGame < ApplicationRecord
|
|
belongs_to :user
|
|
belongs_to :guessed_post, class_name: 'Post'
|
|
belongs_to :correct_post, class_name: 'Post'
|
|
has_many :question_suggestions,
|
|
class_name: 'GekanatorQuestionSuggestion',
|
|
dependent: :delete_all
|
|
has_many :question_examples,
|
|
class_name: 'GekanatorQuestionExample',
|
|
dependent: :delete_all
|
|
|
|
validates :answers, presence: true
|
|
validates :question_count, numericality: { greater_than_or_equal_to: 0 }
|
|
validates :won, inclusion: { in: [true, false] }
|
|
end
|