# Multiple layers nested has\_many through

**URL:** <https://www.ruby-forum.com/t/multiple-layers-nested-has-many-through/106261>\
**Category:** Rails\
**Created:** [June 7, 2007, 9:53pm UTC](https://www.ruby-forum.com/t/multiple-layers-nested-has-many-through/106261 "2007-06-07T21:53:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericgoodwin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c68b51/32.png) [@ericgoodwin](https://www.ruby-forum.com/u/ericgoodwin)\
**Post date:** [June 7, 2007, 9:53pm UTC](https://www.ruby-forum.com/t/multiple-layers-nested-has-many-through/106261/1 "2007-06-07T21:53:42Z")

</div>

I’ve seen previous posts finding ways to do multiple has\_many :through  
assocations like the following

class A \< ActiveRecord::Base

has\_many :xs  
has\_many :ys, :through=\>:xs  
has\_many :zs, :through=\>:ys

end

I’ve seen a patch for this, however, I’m not doing edge rails, and I  
couldn’t copy over the code and actually get it working via a patch I  
could put in my /lib directory.

Does anyone have some easy suggestions for getting my Rails 1.2 to  
support this?

---

<div class="post-metadata">

**Author:** ![ericgoodwin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c68b51/32.png) [@ericgoodwin](https://www.ruby-forum.com/u/ericgoodwin)\
**Post date:** [July 13, 2007, 8:31am UTC](https://www.ruby-forum.com/t/multiple-layers-nested-has-many-through/106261/2 "2007-07-13T08:31:15Z")

</div>

The patch wasn’t applied yet, but the author created a plugin:

[http://code.torchbox.com/svn/rails/plugins/nested\_has\_many\_through/](http://code.torchbox.com/svn/rails/plugins/nested_has_many_through/)

On Jun 7, 4:53 pm, Aryk G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
