我有
class Question < ActiveRecord::Base
has_many :tasks, :as => :task
end
class QuestionPlayer < Question
end
class QuestionGame < Question
end
class Tast < ActiveRecord::Base
belongs_to :task, :polymorphic => true
end
当我做
Task.create :task => QuestionPlayer.new
#<Task id: 81, ... task_id: 92, task_type: "Question">
为什么?如何使用 task_type = "QuestionPlayer" 获得任务?