title: Why do I get an "uninitialized constant" error?
body: <p>I have the following code:</p>
  
  <pre><code>class Zombie &lt; ActiveRecord::Base
    attr_accessible  :name, :rotting, :age
    has_many :assignments
    has_many :roles, through: :assignments
  end
  
  class Role &lt; ActiveRecord::Base
    attr_accessible :title
    has_many :assignments
    has_many :zombies, through: :assignments
  end
  
  class Assignments &lt; ActiveRecord::Base
    attr_accessible :role_id, :zombie_id
    belongs_to :zombie
    belongs_to :role
  end
  </code></pre>
  
  <p>In the console, when I try to run this code:</p>
  
  <pre><code>zombie = Zombie.first
  role = Role.first
  zombie.assignments.create(role: role)
  </code></pre>
  
  <p>I am getting the following error:</p>
  
  <pre><code>NameError: uninitialized constant Zombie::Assignment.
  </code></pre>
  
  <p>Did I made any mistakes here?</p>