title: Rails 3 query between two tables
body: <p>I am trying to find all <code>learners</code> associated with a particular <code>event</code>. I am calling those folks <em>registrants</em>. Right now here is what I have in my controller:</p>
  <pre><code>@registrants = EventConnection.where(event_id: @event.id, connectiontype: 6)
  </code></pre>
  <p>...and in my view I am doing:</p>
  <pre><code>&lt;% @registrants.each do |r| %&gt;
     &lt;%= Learner.find(r.learner.id).name %&gt;
  &lt;% end %&gt;
  </code></pre>
  <p>I would like the query from my controller to return a set of learners so I could just do something like:</p>
  <pre><code>&lt;% @registrants.each do |r| %&gt;
     &lt;%= r.name %&gt;
  &lt;% end %&gt;
  </code></pre>
  <p>Thanks in advance!</p>
  <h1>Edit</h1>
  <p>Learner :has_many event_connections</p>
  <p>EventConnection belongs_to :learner</p>