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.
educoder/app/models/exercise_choice.rb

10 lines
409 B

6 years ago
class ExerciseChoice < ApplicationRecord
belongs_to :exercise_question
6 years ago
has_many :exercise_answers, :dependent => :delete_all
has_many :exercise_standard_answers, :dependent => :delete_all
6 years ago
scope :find_choice_custom, lambda {|k,v| where("#{k} = ?",v)} #根据传入的参数查找问题
scope :left_choice_choose, lambda {|k,v| where("#{k} > ?",v)} #根据传入的参数查找问题
6 years ago
end