You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
429 B
10 lines
429 B
class ExerciseBankChoice < ApplicationRecord
|
|
belongs_to :exercise_bank_question
|
|
has_many :exercise_bank_standard_answers
|
|
|
|
scope :find_choice_custom, lambda {|k,v| where("#{k} = ?",v)} #根据传入的参数查找问题
|
|
scope :left_choice_choose, lambda {|k,v| where("#{k} > ?",v)} #根据传入的参数查找问题
|
|
|
|
validates :choice_text, length: { maximum: 500, too_long: "不能超过500个字符" }
|
|
|
|
end |