educoder/app/models/exercise_bank_standard_answ...

9 lines
336 B

class ExerciseBankStandardAnswer < ApplicationRecord
belongs_to :exercise_bank_question
belongs_to :exercise_bank_choice
#attr_accessible :answer_text
scope :standard_by_ids, lambda { |s| where(exercise_bank_choice_id: s) }
validates :answer_text, length: { maximum: 5000, too_long: "不能超过5000个字符" }
end