rails has many relation through other table
<p>I have 4 tables, All of them are connected to each other.</p>

<pre><code>restaurant -&gt; has_many -&gt; menus
menu -&gt; has_many -&gt; categories
category -&gt; has_many -&gt; menu items
</code></pre>

<p>I tried to access categories from restaurant through menu table and it is not working</p>

<p>I want to access categories and menu items from restaurant table, is it possible </p>

<p>for example</p>

<pre><code>Restaurant.find(1).categories
Restaurant.find(1).menu_items
</code></pre>