title: Merge results from two has_many associations with the same model
body: <p>I have users. Users can poke other users, as well as poke themselves. Each poke is directional, and group pokes don't exist. I want to list all pokes (incoming or outgoing) for a given user, without duplicating self-pokes (which exist as both incoming_ and outgoing_pokes).</p>
  
  <p>Here are my models:</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
    has_many :outgoing_pokes, :class_name =&gt; "Poke", :foreign_key =&gt; :poker_id
    has_many :incoming_pokes, :class_name =&gt; "Poke", :foreign_key =&gt; :pokee_id
  end
  
  class Poke &lt; ActiveRecord::Base
    belongs_to :poker, :class_name =&gt; "User"
    belongs_to :pokee, :class_name =&gt; "User"
  end
  </code></pre>
  
  <p>I tried creating a method in the <code>User</code> model to merge the pokes:</p>
  
  <pre><code>def all_pokes
    outgoing_pokes.merge(incoming_pokes)
  end
  </code></pre>
  
  <p>but that returns only the self-pokes (those that are both incoming_ and outgoing_pokes). Ideas? Is there a clean way to do this using associations directly?</p>
  
  <p>Also, in the merged list, it'd be great to have two booleans for each poke to record how they're related to the current user. Something like <code>outgoing</code> and <code>incoming</code>.</p>