I have a model named AnswerConnection
, who has two foreign keys from Answer
model: answer_1
and answer_2
.
In my Answer
model I have defined:
has_many :connections, through: :answer_connections, source: :answer_2
However, the relationship is simmetrycal: if answer_1 is connected to answer_2, answer_2 is connected to answer_1. This means that when I search the connections of an specific answer, I need to check if its present in answer_1 or answer_2 field.
There is possible to define a relationship attending this (like if I could define two values in :source
parameter)?