has_one :through type problem


I have a set of models with the following relationships:

parent has_one intermediary
intermediary has_one child

I would like to be able to search the parent table based on the value
of child but I don't know how to do the join properly.

Does anyone have any idea?

Thanks in advance,