<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-7625526986034013157.post705595117810406094..comments</id><updated>2011-03-28T09:09:29.120-07:00</updated><category term='plugins rails'/><category term='essays'/><category term='ruby'/><category term='git-tmbundle'/><category term='vim'/><category term='textmate'/><category term='solutions'/><category term='javascript'/><category term='git'/><category term='nerd'/><title type='text'>Comments on Tim, the Enchanter: How to has_many :through a has_many :through</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://tim.theenchanter.com/feeds/705595117810406094/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7625526986034013157/705595117810406094/comments/default'/><link rel='alternate' type='text/html' href='http://tim.theenchanter.com/2008/10/how-to-hasmany-through-hasmany-through.html'/><author><name>Tim Harper</name><uri>http://www.blogger.com/profile/03349408198556972919</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_7HPuw-ljjoY/S7eBtBJOBlI/AAAAAAAAAhg/Oo_4-NSOb6k/S220/tim.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7625526986034013157.post-840599563943291083</id><published>2011-03-28T07:43:57.345-07:00</published><updated>2011-03-28T07:43:57.345-07:00</updated><title type='text'>I like the solution, though I would prefer to keep...</title><content type='html'>I like the solution, though I would prefer to keep as much code on the User side (in this scenario) as possible.  To that effect, and with the inclusion of AREL into Rails 3, you can do this:&lt;br /&gt;&lt;br /&gt;  class User &amp;lt; ActiveRecord::Base&lt;br /&gt;    ...&lt;br /&gt;    has_many :user_conversations&lt;br /&gt;    has_many :conversations, :through =&amp;gt; :user_conversations&lt;br /&gt;&lt;br /&gt;    def messages&lt;br /&gt;      Message.where(:user_conversations =&amp;gt; conversations)&lt;br /&gt;    end&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;This will remove any need to add an extra method on the Messages side of the relationship.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7625526986034013157/705595117810406094/comments/default/840599563943291083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7625526986034013157/705595117810406094/comments/default/840599563943291083'/><link rel='alternate' type='text/html' href='http://tim.theenchanter.com/2008/10/how-to-hasmany-through-hasmany-through.html?showComment=1301323437345#c840599563943291083' title=''/><author><name>Adam</name><uri>http://www.blogger.com/profile/13008130859310225940</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://tim.theenchanter.com/2008/10/how-to-hasmany-through-hasmany-through.html' ref='tag:blogger.com,1999:blog-7625526986034013157.post-705595117810406094' source='http://www.blogger.com/feeds/7625526986034013157/posts/default/705595117810406094' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1167507001'/></entry><entry><id>tag:blogger.com,1999:blog-7625526986034013157.post-6503191075325327616</id><published>2009-03-11T04:32:00.000-07:00</published><updated>2009-03-11T04:32:00.000-07:00</updated><title type='text'>Thank you - this was a big help to me! :)</title><content type='html'>Thank you - this was a big help to me! :)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7625526986034013157/705595117810406094/comments/default/6503191075325327616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7625526986034013157/705595117810406094/comments/default/6503191075325327616'/><link rel='alternate' type='text/html' href='http://tim.theenchanter.com/2008/10/how-to-hasmany-through-hasmany-through.html?showComment=1236771120000#c6503191075325327616' title=''/><author><name>Casper Fabricius</name><uri>http://www.blogger.com/profile/10677028529604524610</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://tim.theenchanter.com/2008/10/how-to-hasmany-through-hasmany-through.html' ref='tag:blogger.com,1999:blog-7625526986034013157.post-705595117810406094' source='http://www.blogger.com/feeds/7625526986034013157/posts/default/705595117810406094' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-689584995'/></entry><entry><id>tag:blogger.com,1999:blog-7625526986034013157.post-6783300734819034907</id><published>2008-10-03T08:40:00.000-07:00</published><updated>2008-10-03T08:40:00.000-07:00</updated><title type='text'>Well sir, you truly rock.  That is a much better s...</title><content type='html'>Well sir, you truly rock.  That is a much better solution than my home-brewed work-around.&lt;BR/&gt;&lt;BR/&gt;Thanks for sharing</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7625526986034013157/705595117810406094/comments/default/6783300734819034907'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7625526986034013157/705595117810406094/comments/default/6783300734819034907'/><link rel='alternate' type='text/html' href='http://tim.theenchanter.com/2008/10/how-to-hasmany-through-hasmany-through.html?showComment=1223048400000#c6783300734819034907' title=''/><author><name>Tim Harper</name><uri>http://www.blogger.com/profile/03349408198556972919</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://tim.theenchanter.com/2008/10/how-to-hasmany-through-hasmany-through.html' ref='tag:blogger.com,1999:blog-7625526986034013157.post-705595117810406094' source='http://www.blogger.com/feeds/7625526986034013157/posts/default/705595117810406094' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-2142473342'/></entry><entry><id>tag:blogger.com,1999:blog-7625526986034013157.post-5438629342222687907</id><published>2008-10-03T01:44:00.000-07:00</published><updated>2008-10-03T01:44:00.000-07:00</updated><title type='text'>I had a similar issue a week ago and found this:&lt;b...</title><content type='html'>I had a similar issue a week ago and found this:&lt;BR/&gt;&lt;BR/&gt;&lt;A HREF="http://github.com/ianwhite/nested_has_many_through" REL="nofollow"&gt;http://github.com/ianwhite/nested_has_many_through&lt;/A&gt;&lt;BR/&gt;&lt;BR/&gt;There is an open ticket (&lt;A HREF="http://dev.rubyonrails.org/ticket/6461" REL="nofollow"&gt;6461 in Trac&lt;/A&gt; and &lt;A HREF="http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1152" REL="nofollow"&gt;1152 in Lighthouse&lt;/A&gt;) to support this in Rails.&lt;BR/&gt;&lt;BR/&gt;Jon</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7625526986034013157/705595117810406094/comments/default/5438629342222687907'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7625526986034013157/705595117810406094/comments/default/5438629342222687907'/><link rel='alternate' type='text/html' href='http://tim.theenchanter.com/2008/10/how-to-hasmany-through-hasmany-through.html?showComment=1223023440000#c5438629342222687907' title=''/><author><name>jon</name><uri>http://www.blogger.com/profile/12461046100318840658</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp0.blogger.com/__sJnCA82rpw/SDaa0DoQc2I/AAAAAAAAAAU/mxdT2NRdVak/S220/BurmaSauce_110x129.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://tim.theenchanter.com/2008/10/how-to-hasmany-through-hasmany-through.html' ref='tag:blogger.com,1999:blog-7625526986034013157.post-705595117810406094' source='http://www.blogger.com/feeds/7625526986034013157/posts/default/705595117810406094' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-903822492'/></entry></feed>
