<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Savannah Younts</title>
    <description>The latest articles on Forem by Savannah Younts (@savyounts).</description>
    <link>https://forem.com/savyounts</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F103753%2Feeb8d395-8627-4d32-921a-dae5f310d027.jpeg</url>
      <title>Forem: Savannah Younts</title>
      <link>https://forem.com/savyounts</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/savyounts"/>
    <language>en</language>
    <item>
      <title>Multiple ActiveRecord Associations</title>
      <dc:creator>Savannah Younts</dc:creator>
      <pubDate>Wed, 03 Oct 2018 04:01:11 +0000</pubDate>
      <link>https://forem.com/savyounts/multiple-activerecord-associations-4o4o</link>
      <guid>https://forem.com/savyounts/multiple-activerecord-associations-4o4o</guid>
      <description>&lt;p&gt;Hey so I know with ActiveRecord I can have associations like belongs_to, has_many and has_many through, but how would it work if I have a model that has two associations with the same second model?&lt;/p&gt;

&lt;p&gt;For example, if I have three class models Foo, Bar, &amp;amp; Baz. If &lt;/p&gt;

&lt;p&gt;class Foo&lt;br&gt;
    has_many :baz&lt;br&gt;
    has_many :bar &lt;br&gt;
    has_many :bar, through: :baz &lt;br&gt;
end &lt;/p&gt;

&lt;p&gt;Basically, I want my foo concept to be able to create a bar but also to have bars through baz. Can I use it the way I have it set up there (with the other associations set up to match) and if I can, am I able to call .bars on my foo object to get back ALL the bars from both associations?&lt;/p&gt;

</description>
      <category>help</category>
    </item>
  </channel>
</rss>
