I have a Rule model that references a Question model using a question_id field.
The rule belongs_to question and the question has_many rules.
So, I can do rule.question.name.
But, there is also a show_question_id field. It should also reference the Question model, but that’s what I can’t figure out.
I’d like to be able to do something like rule.show_question.name.
Rails infers the foreign key and the class name from the name of the association, so you need to tell it to use
Questionrather than the (non-existent)ShowQuestion