title: How do I explore the results of an ActiveRecord relation?
body: <p>This is what I am doing:</p>
  
  <pre><code>[72] pry(main)&gt; Connection.joins(:inviter_memberships).where(inviter_memberships: { invited: c.inviter_membership.invited })
  =&gt; #&lt;Connection::ActiveRecord_Relation:0x3fe19aa2ce28&gt;
  </code></pre>
  
  <p>But not sure how to explore that to see what records apply to that relation.</p>
  
  <p>I have a <code>Connection</code> model, that has the following associations:</p>
  
  <pre><code># == Schema Information
  #
  # Table name: connections
  #
  #  id                    :integer          not null, primary key
  #  membership_id         :integer
  #  invited_membership_id :integer
  # truncated for brevity
  
  class Connection &lt; ActiveRecord::Base
    belongs_to :inviter_membership, class_name: "Membership", foreign_key: "membership_id"
    belongs_to :invited_membership, class_name: "Membership", foreign_key: "invited_membership_id"    
  end
  </code></pre>
  
  <p>And I have a <code>Membership</code> model that looks like this:</p>
  
  <pre><code>class Membership &lt; ActiveRecord::Base
    belongs_to :inviter, class_name: "User", foreign_key: "user_id"
    belongs_to :invited, class_name: "User", foreign_key: "invited_id"
    has_many :connections, dependent: :destroy
  end
  </code></pre>