title: Rails Console Error... NameError: uninitialized constant
body: <p>I'm testing my assocations in my models in rails. I'm on Rails 3.2, and ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]
  When I type "User.first" it works fine, returning the first user. When I type "Gear.first" it also works fine. However when I try to access gear through the user like "User.first.gears" I keep getting the following error:</p>
  
  <pre><code>NameError: uninitialized constant User::UserGear
  from /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.2.0/lib/active_record/inheritance.rb:119:in `compute_type'
  from /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.2.0/lib/active_record/reflection.rb:172:in `klass'
  from /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.2.0/lib/active_record/reflection.rb:385:in `block in source_reflection'
  from /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.2.0/lib/active_record/reflection.rb:385:in `collect'
  from /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.2.0/lib/active_record/reflection.rb:385:in `source_reflection'
  from /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.2.0/lib/active_record/reflection.rb:508:in `check_validity!'
  from /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.2.0/lib/active_record/associations/association.rb:26:in `initialize'
  from /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.2.0/lib/active_record/associations/collection_association.rb:24:in `initialize'
  from /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.2.0/lib/active_record/associations/has_many_through_association.rb:10:in `initialize'
  from /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.2.0/lib/active_record/associations.rb:157:in `new'
  from /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.2.0/lib/active_record/associations.rb:157:in `association'
  from /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.2.0/lib/active_record/associations/builder/association.rb:44:in `block in define_readers'
  from (irb):2
  from /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0/lib/rails/commands/console.rb:47:in `start'
  from /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0/lib/rails/commands/console.rb:8:in `start'
  from /Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0/lib/rails/commands.rb:41:in `&lt;top (required)&gt;'
  from script/rails:6:in `require'
  from script/rails:6:in `&lt;main&gt;'1.9.3p0 :003 &gt; exit
  </code></pre>
  
  <p>Here are my models
  <strong>User Class:</strong></p>
  
  <pre><code>class User &lt; ActiveRecord::Base
  
    attr_accessible :first_name, :last_name, :email, :password, :password_confirmation
    has_secure_password
    has_many :gears, through: :user_gears
    has_many :user_gears
    before_save :create_remember_token
  
    email_regex = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
  
    validates :first_name,  presence: true,
                            length:  {:maximum =&gt; 50 }
    validates :last_name,  presence: true,
                           length:  {:maximum =&gt; 50 }
    validates :email,      presence: true,
                           format:  {:with =&gt; email_regex},
                           uniqueness:  {:case_sensitive =&gt; false}
    validates :password,   presence: true,
                           confirmation: true,
                           length: {within: 6..40}
  
    def name
     first_name + " " + last_name
    end
  
    private
  
      def create_remember_token
          self.remember_token = SecureRandom.urlsafe_base64
      end
  
  end
  </code></pre>
  
  <p><strong>Gears Class</strong></p>
  
  <pre><code>class Gear &lt; ActiveRecord::Base
    attr_accessible :title, :size, :price, :image_url, :sub_category_id
    has_many :users, through: :user_gears
    has_many :user_gears
    belongs_to :sub_category
  
    validates :title, presence: true
    validates :size,  presence: true
    validates :price, presence: true
    validates :sub_category_id, presence: true
  end
  </code></pre>
  
  <p><strong>User_Gears Class</strong></p>
  
  <pre><code>class UserGears &lt; ActiveRecord::Base
    belongs_to :gear
    belongs_to :user
  end
  </code></pre>
  
  <p>What am I missing?</p>