tag:blogger.com,1999:blog-1165952950664514722.post7211558223273990684..comments2010-08-15T07:00:26.538-07:00Comments on Tall John: Rails: 'Has_many through' association across databasesJohn Mainhttp://www.blogger.com/profile/02982368616584341850noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-1165952950664514722.post-18010396108616285162009-05-12T12:58:00.000-07:002009-05-12T12:58:00.000-07:00You could simplify your code a bit using a Array::...You could simplify your code a bit using a Array::collect -<br /><br />class Order << ActiveRecord::Base<br /> has_many :order_users<br /><br /> def users<br /> order_users.collect(&:user)<br /> end<br />end<br /><br />class user << ActiveRecord::Base<br /> has_many :order_users<br /><br /> def orders<br /> order_users.collect(&:order)<br /> end<br />end<br /><br />Also, I disagree with the statement that "relationship will work just like any other 'has_many through'" as none of the other functions (most notably collection<< ) are not implemented.Anonymoushttps://www.blogger.com/profile/01458756403823307228noreply@blogger.com