<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Rails: &#8216;Has_many through&#8217; Association Across Databases</title>
	<atom:link href="http://www.setfiremedia.com/blog/rails-has-many-through-association-across-databases/feed" rel="self" type="application/rss+xml" />
	<link>http://www.setfiremedia.com/blog/rails-has-many-through-association-across-databases</link>
	<description>Hot ideas for the web.</description>
	<lastBuildDate>Thu, 11 Mar 2010 16:17:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Moschops</title>
		<link>http://www.setfiremedia.com/blog/rails-has-many-through-association-across-databases/comment-page-1#comment-1067</link>
		<dc:creator>Moschops</dc:creator>
		<pubDate>Thu, 09 Jul 2009 22:52:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.setfiremedia.com/blog/?p=102#comment-1067</guid>
		<description>This works until you update... I think you need

def users
@users &#124;&#124;= order_users.collect(&amp;:user)
end</description>
		<content:encoded><![CDATA[<p>This works until you update&#8230; I think you need</p>
<p>def users<br />
@users ||= order_users.collect(&amp;:user)<br />
end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leon</title>
		<link>http://www.setfiremedia.com/blog/rails-has-many-through-association-across-databases/comment-page-1#comment-909</link>
		<dc:creator>Leon</dc:creator>
		<pubDate>Wed, 29 Oct 2008 10:09:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.setfiremedia.com/blog/?p=102#comment-909</guid>
		<description>i&#039;m using
establish_connection(ActiveRecord::Base.configurations[&quot;legacy_#{RAILS_ENV}&quot;])
inside my legacy models so you can use a development and production legacy database
just my 2c</description>
		<content:encoded><![CDATA[<p>i&#8217;m using<br />
establish_connection(ActiveRecord::Base.configurations["legacy_#{RAILS_ENV}"])<br />
inside my legacy models so you can use a development and production legacy database<br />
just my 2c</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leandro Gualter</title>
		<link>http://www.setfiremedia.com/blog/rails-has-many-through-association-across-databases/comment-page-1#comment-735</link>
		<dc:creator>Leandro Gualter</dc:creator>
		<pubDate>Fri, 17 Oct 2008 03:19:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.setfiremedia.com/blog/?p=102#comment-735</guid>
		<description>I think that the code

def orders
  order = []
  order_users.each do &#124;ou&#124;
    order &lt;&lt; ou.user
  end
  order
end

should be 

def orders
  order = []
  order_users.each do &#124;ou&#124;
    order &lt;&lt; ou.order
  end
  order
end</description>
		<content:encoded><![CDATA[<p>I think that the code</p>
<p>def orders<br />
  order = []<br />
  order_users.each do |ou|<br />
    order &lt;&lt; ou.user<br />
  end<br />
  order<br />
end</p>
<p>should be </p>
<p>def orders<br />
  order = []<br />
  order_users.each do |ou|<br />
    order &lt;&lt; ou.order<br />
  end<br />
  order<br />
end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Onno</title>
		<link>http://www.setfiremedia.com/blog/rails-has-many-through-association-across-databases/comment-page-1#comment-708</link>
		<dc:creator>Onno</dc:creator>
		<pubDate>Wed, 15 Oct 2008 12:34:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.setfiremedia.com/blog/?p=102#comment-708</guid>
		<description>I second the &quot;embrace collect&quot; advise. To make this advise somewhat clearer to mere mortals, here&#039;s a rewrite:

def users
  users &#124;&#124;= order_users.collect {&#124;ou&#124; ou.user}
end

For clarification of the ampersand (&amp;) notation, please see &lt;a href=&quot;http://api.rubyonrails.com/classes/Symbol.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>I second the &#8220;embrace collect&#8221; advise. To make this advise somewhat clearer to mere mortals, here&#8217;s a rewrite:</p>
<p>def users<br />
  users ||= order_users.collect {|ou| ou.user}<br />
end</p>
<p>For clarification of the ampersand (&amp;) notation, please see <a href="http://api.rubyonrails.com/classes/Symbol.html" rel="nofollow">here</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aa</title>
		<link>http://www.setfiremedia.com/blog/rails-has-many-through-association-across-databases/comment-page-1#comment-699</link>
		<dc:creator>aa</dc:creator>
		<pubDate>Tue, 14 Oct 2008 19:35:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.setfiremedia.com/blog/?p=102#comment-699</guid>
		<description>embrace .collect:

def users
  users &#124;&#124;= order_users.collect(&amp;:user)
end

def orders
  orders &#124;&#124;= order_users.collect(&amp;:user)
end</description>
		<content:encoded><![CDATA[<p>embrace .collect:</p>
<p>def users<br />
  users ||= order_users.collect(&amp;:user)<br />
end</p>
<p>def orders<br />
  orders ||= order_users.collect(&amp;:user)<br />
end</p>
]]></content:encoded>
	</item>
</channel>
</rss>
