<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -218,7 +218,7 @@ module Zetetic #:nodoc:
         # * &lt;tt&gt;:foreign_key&lt;/tt&gt; - name of the foreign key for the origin side of relation - 
         #   i.e. person_id.
         # * &lt;tt&gt;:association_foreign_key&lt;/tt&gt; - name of the foreign key for the target side, 
-        #   i.e. erson_id_target. Defaults to the same value as +foreign_key+ with a &lt;tt&gt;_target&lt;/tt&gt; suffix
+        #   i.e. person_id_target. Defaults to the same value as +foreign_key+ with a &lt;tt&gt;_target&lt;/tt&gt; suffix
         # * &lt;tt&gt;:conditions&lt;/tt&gt; - optional, standard ActiveRecord SQL contition clause
         #
         def acts_as_network(relationship, options = {})
@@ -280,6 +280,29 @@ module Zetetic #:nodoc:
       end
       
       module ClassMethods
+        # = acts_as_union
+        # acts_as_union simply presents a union'ed view of one or more ActiveRecord 
+        # relationships (has_many or has_and_belongs_to_many, acts_as_network, etc).
+        # 
+        #   class Person &lt; ActiveRecord::Base
+        #     acts_as_network :friends
+        #     acts_as_network :colleagues, :through =&gt; :invites, :foreign_key =&gt; 'person_id', 
+        #                     :conditions =&gt; [&quot;is_accepted = 't'&quot;]
+        #     acts_as_union   :aquantainces, [:friends, :colleagues]
+        #   end
+        #
+        # In this case a call to the +aquantainces+ method will return a UnionCollection on both 
+        # a person's +friends+ and their +colleagues+. Likewise, finder operations will work accross 
+        # the two distinct sets as if they were one. Thus, for the following code
+        # 
+        #   stephen = Person.find_by_name('Stephen')
+        #   # search for user by login
+        #   billy = stephen.aquantainces.find_by_name('Billy')
+        #
+        # both Stephen's +friends+ and +colleagues+ collections would be searched for someone named Billy.
+        # 
+        # +acts_as_union+ doesn't accept any options.
+        #
         def acts_as_union(relationship, methods)
           # define the accessor method for the union.
           # i.e. if People acts_as_union :jobs, this method is defined as def jobs</diff>
      <filename>lib/zetetic/acts/network.rb</filename>
    </modified>
    <modified>
      <diff>@@ -23,12 +23,18 @@ class Person &lt; ActiveRecord::Base
   # simple network relation through a has_and_belongs_to_many table
   acts_as_network :connections
   
+  # network relations has_and_belongs_to_many with custom table and foreign_key names
   acts_as_network :friends, :join_table =&gt; :friends, :foreign_key =&gt; 'person_id', 
                   :association_foreign_key =&gt; 'person_id_friend'
   
+  # network relationship with has_many_through and overrides
   acts_as_network :colleagues, :through =&gt; :invites, 
                   :foreign_key =&gt; 'person_id', :association_foreign_key =&gt; 'person_id_target', 
                   :conditions =&gt; [&quot;is_accepted = 't'&quot;]
+                  
+  # simple usage of acts_as_union to combine friends and colleagues sets
+  acts_as_union   :associates, [:friends, :colleagues]
+                                 
 end
 
 class Invite &lt; ActiveRecord::Base
@@ -122,13 +128,13 @@ class UnionCollectionTest &lt; Test::Unit::TestCase
   
   def test_empty_sets
     assert_equal Zetetic::Acts::UnionCollection.new().size, 0
-    assert_equal Zetetic::Acts::UnionCollection.new().to_a, []
+    assert_equal Zetetic::Acts::UnionCollection.new().to_ary, []
     assert_equal Zetetic::Acts::UnionCollection.new([],[]).size, 0
-    assert_equal Zetetic::Acts::UnionCollection.new([],[]).to_a, []
+    assert_equal Zetetic::Acts::UnionCollection.new([],[]).to_ary, []
     assert_equal Zetetic::Acts::UnionCollection.new(nil,nil).size, 0
-    assert_equal Zetetic::Acts::UnionCollection.new(nil,nil).to_a, []
+    assert_equal Zetetic::Acts::UnionCollection.new(nil,nil).to_ary, []
     assert_equal Zetetic::Acts::UnionCollection.new([],nil).size, 0
-    assert_equal Zetetic::Acts::UnionCollection.new([],nil).to_a, []
+    assert_equal Zetetic::Acts::UnionCollection.new([],nil).to_ary, []
   end
   
   def test_mixed_sets
@@ -243,7 +249,7 @@ class ActsAsNetworkTest &lt; Test::Unit::TestCase
 
     jane.reload and jack.reload and alex.reload
 
-    assert_equal [alex].to_a, jack.colleagues.find(:all, :conditions =&gt; { :name =&gt; &quot;Alex&quot; }).to_a
+    assert_equal [alex].to_ary, jack.colleagues.find(:all, :conditions =&gt; { :name =&gt; &quot;Alex&quot; }).to_ary
   end
   
   def test_outbound_habtm</diff>
      <filename>test/network_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6ac673c3ad2f84d30750e202efa65890db2e1f5d</id>
    </parent>
  </parents>
  <author>
    <name>Stephen Lombardo</name>
    <email>sjlombardo@zetetic.net</email>
  </author>
  <url>http://github.com/sjlombardo/acts_as_network/commit/358fc0c3a8b596bb83bb479d361039184b9ecec0</url>
  <id>358fc0c3a8b596bb83bb479d361039184b9ecec0</id>
  <committed-date>2008-06-02T14:20:25-07:00</committed-date>
  <authored-date>2008-06-02T14:20:25-07:00</authored-date>
  <message>added documentation and example for acts_as_union</message>
  <tree>3690fbfcf6e8cf9b003e65956dc37f8217c96948</tree>
  <committer>
    <name>Stephen Lombardo</name>
    <email>sjlombardo@zetetic.net</email>
  </committer>
</commit>
