[Rails] Re: Polymorphic problems with an abstract class

2008-09-09 Thread Subbu
Ilan, Mcq and TrueFalse descend from question and not choice. The correct structure is below. app/models/choice.rb class Question < ActiveRecord::Base end app/models/question.rb class Question < ActiveRecord::Base self.abstract_class = true end class Mcq < Question;end class TrueFalse < Que

[Rails] Re: Polymorphic problems with an abstract class

2008-09-09 Thread Ilan Berci
the fact that you had 2 definitions each for your concretes looks to be your issue.. in order to do this and behave well under rails you will need exactly 3 files and 3 classes.. I am willing to bet that one of your implementations had the choices() method implemented and the other didn't.. a

[Rails] Re: Polymorphic problems with an abstract class

2008-09-09 Thread Subbu
Looks like I have found one solution. I had 2 definitions for the classes Mcq and TrueFalse, one in separate files named mcq.rb and true_false.rb and another definition in the file question.rb (the abstract class itself). I had to have these definitions in 2 files because otherwise I couldn't cal