title: Rails belongs_to association (with :class_name) returns nil
body: <p>I'm relatively new to Rails development and I'm having a minor associations problem. I'd like to name an association something different than the model it's linked to.</p>
  
  <p>I have the following 2 models:</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
    has_many :events
  end
  
  class Event &lt; ActiveRecord::Base
    belongs_to :admin, :class_name =&gt; "User" # So we can call event.admin to retrieve the User who owns this Event
  end
  </code></pre>
  
  <p>I build a User as follows:</p>
  
  <pre><code>event = event.create! :title =&gt; "New Event"
  
  user = User.create! :username =&gt; "thinkswan"
  user.events &lt;&lt; event
  user.save
  </code></pre>
  
  <p>When I hop into the console I receive the following:</p>
  
  <pre><code>irb&gt; user = User.find(1)
  irb&gt; user.events
  =&gt; [#&lt;Event id: 1, title: "New Event", user_id: 1, created_at: "2011-06-09 06:41:09", updated_at: "2011-06-09 06:41:10"&gt;]
  
  irb&gt; event = Event.find(1)
  irb&gt; event.user_id
  =&gt; 1
  irb&gt; event.admin
  =&gt; nil
  </code></pre>
  
  <p>Can anyone explain why the <code>admin</code> association isn't returning the User it's pointing to? Thanks!</p>