<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Rails Forum - Ruby on Rails Help and Discussion Forum - Don't get access to associated Tables with .include()]]></title>
		<link>http://railsforum.com/viewtopic.php?id=52256</link>
		<description><![CDATA[The most recent posts in Don't get access to associated Tables with .include().]]></description>
		<lastBuildDate>Thu, 31 Jan 2013 16:16:26 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Don't get access to associated Tables with .include()]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=158709#p158709</link>
			<description><![CDATA[<p>Try just<br /></p><div class="codebox"><pre><code>Product.includes(:prices)</code></pre></div><p>See more details at:<br /><a href="http://asciicasts.com/episodes/181-include-vs-joins">http://asciicasts.com/episodes/181-include-vs-joins</a><br /><a href="http://guides.rubyonrails.org/active_record_querying.html">http://guides.rubyonrails.org/active_re &#133; rying.html</a></p>]]></description>
			<author><![CDATA[dummy@example.com (Javix)]]></author>
			<pubDate>Thu, 31 Jan 2013 16:16:26 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=158709#p158709</guid>
		</item>
		<item>
			<title><![CDATA[Don't get access to associated Tables with .include()]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=158707#p158707</link>
			<description><![CDATA[<p>Hey guys,</p><p>I&#039;m a beginner in coding Rails and have a problem with joining tables. I have 2 models:<br /></p><div class="codebox"><pre><code>class Price &lt; ActiveRecord::Base
  belongs_to :product
end

class Product &lt; ActiveRecord::Base
  has_many :prices
end</code></pre></div><p>Now I want to get a List of all Products with their prices. (One product has many prices, because I want to save price changes).</p><p>I tryed<br /></p><div class="codebox"><pre><code>Product.includes(:prices).all</code></pre></div><p>but this only returns the whole Product table without the prices.</p><p>With .joins() it&#039;s the same.</p><p>Any suggestions?</p><p>Charon</p>]]></description>
			<author><![CDATA[dummy@example.com (charon88)]]></author>
			<pubDate>Thu, 31 Jan 2013 13:48:27 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=158707#p158707</guid>
		</item>
	</channel>
</rss>
