I currently have a Product model and a Question model.
I have originally developed an application and in this application I had this relationship between them:
Product has_many :questions Question
belongs_to :product
However, I know now that a Question doesn’t always have to belong to a Product.
What kind of relationship or solution should I be doing for something like this?
Note: I am using Rails 2.3.8
Unless I misunderstood your question, I don’t see any problem with what you have. The Question records that do not belong to a Product will simply have a product_id column set to null.
There could be an issue if you have a validation in your Question model that checks the presence of a product_id but if that’s the case, simply remove the validation on product_id.
You may also want to check that there is no constraint at the database level that prevents the product_id foreign key from being null.