<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1 +1,2 @@
-ActiveRecord::Base.send :include, Zetetic::Acts::Network
\ No newline at end of file
+ActiveRecord::Base.send :include, Zetetic::Acts::Network
+ActiveRecord::Base.send :include, Zetetic::Acts::Union
\ No newline at end of file</diff>
      <filename>init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -267,5 +267,23 @@ module Zetetic #:nodoc:
         end
       end
     end
-  end
+  
+    module Union
+      def self.included(base)
+        base.extend ClassMethods
+      end
+      
+      module ClassMethods
+        def acts_as_union(relationship, methods)
+          # define the accessor method for the reciprocal network relationship view itself. 
+          # i.e. if People acts_as_network :contacts, this method is defind as def contacts
+          class_eval &lt;&lt;-EOV
+            def #{relationship}
+              UnionCollection.new(#{methods.collect{|m| &quot;self.#{m.to_s}&quot;}.join(',')})
+            end
+          EOV
+        end
+      end
+    end # module Union
+  end  # module Acts
 end</diff>
      <filename>lib/zetetic/acts/network.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,4 +8,8 @@ usa:
 
 amc:
   id: 2
-  name: AMC
\ No newline at end of file
+  name: AMC
+  
+abc:
+  id: 3
+  name: ABC</diff>
      <filename>test/fixtures/channels.yml</filename>
    </modified>
    <modified>
      <diff>@@ -2,33 +2,46 @@ myth_busters:
   id: 0
   name: Myth Busters
   channel_id: 0
+  package: premium
 
 deadliest_catch:
   id: 1
   name: Deadliest Catch
   channel_id: 0
+  package: mega
   
 dirty_jobs:
   id: 2
   name: Dirty Jobs
   channel_id: 0
+  package: mega
 
 monk:
   id: 3
   name: Monk
   channel_id: 1
+  package: basic
 
 psych:
   id: 4
   name: Psych
   channel_id: 1
+  package: basic
 
 burn_notice:
   id: 5
   name: Burn Notice
   channel_id: 1
+  package: premium
 
 mad_men:
   id: 6
   name: Mad Men
-  channel_id: 2
\ No newline at end of file
+  channel_id: 2
+  package: premium
+  
+action_news: 
+  id: 7
+  name: Action News
+  channel_id: 3
+  package: basic
\ No newline at end of file</diff>
      <filename>test/fixtures/shows.yml</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,9 @@ require File.join(File.dirname(__FILE__), 'test_helper')
 
 class Channel &lt; ActiveRecord::Base
   has_many :shows
+  has_many :premium_shows, :class_name =&gt; 'Show', :conditions =&gt; ['package = ?', 'premium']
+  has_many :mega_shows, :class_name =&gt; 'Show', :conditions =&gt; ['package = ?', 'mega']
+  acts_as_union :pay_shows, [ :premium_shows, :mega_shows ]
 end
 
 class Show &lt; ActiveRecord::Base
@@ -40,6 +43,15 @@ class Array
   end
 end
 
+class ActsAsUntionTest &lt; Test::Unit::TestCase
+  fixtures :shows, :channels
+  
+  def test_union_method
+    assert_equal 0, channels(:abc).pay_shows.length
+    assert_equal 3, channels(:discovery).pay_shows.length
+  end
+end
+
 class UnionCollectionTest &lt; Test::Unit::TestCase
   fixtures :shows, :channels
   </diff>
      <filename>test/network_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,6 +7,7 @@ ActiveRecord::Schema.define(:version =&gt; 1) do
   create_table :shows, :force =&gt; true do |t|
     t.column :name, :string
     t.column :channel_id, :integer
+    t.column :package, :string
   end
 
   # people</diff>
      <filename>test/schema.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>4d2ce44f0dd6c757457e48ead5dda842f9fa3e9f</id>
    </parent>
  </parents>
  <author>
    <name>Billy Gray</name>
    <email>wgray@zetetic.net</email>
  </author>
  <url>http://github.com/sjlombardo/acts_as_network/commit/f5230cdfca5191f82e4f50269b6ebb7ba33a193c</url>
  <id>f5230cdfca5191f82e4f50269b6ebb7ba33a193c</id>
  <committed-date>2008-05-30T13:15:39-07:00</committed-date>
  <authored-date>2008-05-30T13:15:39-07:00</authored-date>
  <message>Added acts_as_union method and simple test to acts_as_network plugin</message>
  <tree>d2a493ca113c57e87a9e36110d268305fb867443</tree>
  <committer>
    <name>Billy Gray</name>
    <email>wgray@zetetic.net</email>
  </committer>
</commit>
