37ade2a988
Reviewed-on: #362 Co-authored-by: miteruzo <miteruzo@naver.com> Co-committed-by: miteruzo <miteruzo@naver.com>
18 行
532 B
Ruby
18 行
532 B
Ruby
class GekanatorQuestionExample < ApplicationRecord
|
|
ANSWERS = GekanatorQuestionSuggestion::ANSWERS
|
|
SOURCES = ['initial_suggestion', 'post_game_extra'].freeze
|
|
|
|
belongs_to :gekanator_question
|
|
belongs_to :post
|
|
belongs_to :user
|
|
belongs_to :gekanator_game, optional: true
|
|
|
|
validates :answer, presence: true, inclusion: { in: ANSWERS }
|
|
validates :source, presence: true, inclusion: { in: SOURCES }
|
|
validates :weight,
|
|
presence: true,
|
|
numericality: {
|
|
greater_than: 0
|
|
}
|
|
end
|