title: Rails 4: has_many :through errors
body: <p>Here is my join model:</p>
  
  <pre><code>class CompanyUser &lt; ActiveRecord::Base
    belongs_to :company
    belongs_to :user
  end
  </code></pre>
  
  <p>My <code>User</code> model:</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
    # Include default devise modules. Others available are:
    # :confirmable, :lockable, :timeoutable and :omniauthable
    devise :database_authenticatable, :registerable,
           :recoverable, :rememberable, :trackable, :validatable
  
    ROLES = %w[admin requestor requestor_limited shipping_vendor].freeze
  
    attr_accessor :temp_password
  
    has_many :companies_users
  
    ...
  
  end
  </code></pre>
  
  <p>If I run this in the console: </p>
  
  <pre><code>u = User.first
  u.companies
  </code></pre>
  
  <p>This is the error I am getting:</p>
  
  <p><code>NameError: uninitialized constant User::CompaniesUser</code></p>