[Rails] Column with dynamic db type

2012-05-02 Thread Greg Ma
Hi, I have a Question model where the answer to the question can have multiple db type (integer, string, boolean, ...). I would like to know if you have a better solution than this one: Question: question:string answer_type:string AnsweredQuestion: question_id:integer answer:text

Re: [Rails] Column with dynamic db type

2012-05-02 Thread Jeremy Walker
On 2 May 2012, at 21:25, Greg Ma li...@ruby-forum.com wrote: Hi, I have a Question model where the answer to the question can have multiple db type (integer, string, boolean, ...). I've had a similar situation. I'd use STI to have different models for different answer types. My