title: How can I do a LEFT OUTER JOIN using Rails ActiveRecord?
body: <p>I don't have any ideas. Could you give me any clues (like reference sites). Any help will be appreciated.</p>
  
  <pre class="lang-none prettyprint-override"><code>Model1: GROUP(id, name)
  Model2: USER_GROUP_CMB(id, user_id, group_id)
  </code></pre>
  
  <p>Expected SQL statement:</p>
  
  <pre class="lang-sql prettyprint-override"><code>SELECT * 
  FROM groups AS g LEFT OUTER JOIN user_group_cmbs AS cmb 
              ON g.id = cmb.group_id
  WHERE cmb.user_id = 1
  </code></pre>
  
  <p>I tried to set up associations below but I dont know what to do after this.</p>
  
  <pre class="lang-rb prettyprint-override"><code>class Group &lt; ActiveRecord::Base
    has_many :user_group_cmb
  end
  
  class UserGroupCmb &lt; ActiveRecord::Base
    has_many :group
  end
  </code></pre>
  
  <p>Rails Version: 3.1.1</p>