belongs_to :through


Long time user of rails, fist time poster.

It feels like there should be a belongs_to :through that behaves similarly to has_many :through, but for the belongs_to side of the relationship.

Any thoughts/reasons why this hasn’t been done?

I’d love to contribute something to rails, and this feature would be scratching an itch/need that I have at the moment so seems appropriate. Let me know if there is any value/interest in getting this done, and I can fork the repo and start putting together the patch. Of course any guidance in doing so would be greatly appreciated.



Hi Rob,

Why not use has_one :through? I think it’s what you need :wink:

Simon Courtois

lovely. That was exactly what I need. I’m going to make the suitable update to apidoc as well.


Rails really rocks!

There are many hidden features we don’t know yet. I wish that wycats or dhh may experience that too… THANKS FOR MAKING RAILS


Just spend some time reading the api docs from time to time. Not enough devs do this. Or browse the CHANGELOGS.

Awesome, had the same problem and have been looking for a solution for a long time