<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>vendor/plugins/has_many_polymorphs/.gitignore</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,6 @@
+v2.2. Various fixes.
+
+v2.13. Merge various fixes for Rails 2.2.2.
 
 v2.12. Improvements to the test suite; bugfixes for STI children (rsl). Remove fancy dependency system in favor of using Dispatcher::to_prepare every time.
 </diff>
      <filename>vendor/plugins/has_many_polymorphs/CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -22,6 +22,7 @@ lib/has_many_polymorphs/support_methods.rb
 lib/has_many_polymorphs.rb
 LICENSE
 Manifest
+Rakefile
 README
 test/fixtures/bow_wows.yml
 test/fixtures/cats.yml
@@ -92,10 +93,8 @@ test/integration/app/db/migrate/006_create_double_sti_parents.rb
 test/integration/app/db/migrate/007_create_single_sti_parent_relationships.rb
 test/integration/app/db/migrate/008_create_double_sti_parent_relationships.rb
 test/integration/app/db/migrate/009_create_library_model.rb
-test/integration/app/db/schema.rb
 test/integration/app/doc/README_FOR_APP
 test/integration/app/generators/commenting_generator_test.rb
-test/integration/app/hmp_development
 test/integration/app/lib/library_model.rb
 test/integration/app/public/404.html
 test/integration/app/public/500.html</diff>
      <filename>vendor/plugins/has_many_polymorphs/Manifest</filename>
    </modified>
    <modified>
      <diff>@@ -29,7 +29,7 @@ The plugin also includes a generator for a tagging system, a common use case (se
 
 == Requirements
 
-* Rails 1.2.3 or greater
+* Rails 2.2.2 or greater
 
 = Usage
 </diff>
      <filename>vendor/plugins/has_many_polymorphs/README</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 require File.dirname(__FILE__) + '/../test_helper'
 
-class TagTest &lt; Test::Unit::TestCase
+class TagTest &lt; ActiveSupport::TestCase
   fixtures &lt;%= taggable_models[0..1].join(&quot;, &quot;) -%&gt;
   
   def setup</diff>
      <filename>vendor/plugins/has_many_polymorphs/generators/tagging/templates/tag_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,3 @@
-
 class ActiveRecord::Base #:nodoc:
 
   # These extensions make models taggable. This file is automatically generated and required by your app if you run the tagging generator included with has_many_polymorphs.
@@ -13,7 +12,7 @@ class ActiveRecord::Base #:nodoc:
         begin
           tag = Tag.find_or_create_by_name(tag_name)
           raise Tag::Error, &quot;tag could not be saved: #{tag_name}&quot; if tag.new_record?
-          tag.taggables &lt;&lt; self
+          tags &lt;&lt; tag
         rescue ActiveRecord::StatementInvalid =&gt; e
           raise unless e.to_s =~ /duplicate/i
         end
@@ -66,7 +65,11 @@ class ActiveRecord::Base #:nodoc:
       &lt;%= parent_association_name -%&gt;s.to_s
       #:startdoc:
     end
-    
+
+    def tag_list=(value)
+        tag_with(value)
+    end    
+
     private 
     
     def tag_cast_to_string obj #:nodoc:
@@ -120,7 +123,7 @@ class ActiveRecord::Base #:nodoc:
       sql  = &quot;SELECT #{(scope &amp;&amp; scope[:select]) || options[:select]} &quot;
       sql &lt;&lt; &quot;FROM #{(scope &amp;&amp; scope[:from]) || options[:from]} &quot;
 
-      add_joins!(sql, options, scope)
+      add_joins!(sql, options[:joins], scope)
       
       sql &lt;&lt; &quot;WHERE #{table_name}.#{primary_key} = taggings.taggable_id &quot;
       sql &lt;&lt; &quot;AND taggings.taggable_type = '#{ActiveRecord::Base.send(:class_name_of_active_record_descendant, self).to_s}' &quot;
@@ -144,6 +147,47 @@ class ActiveRecord::Base #:nodoc:
       
       find_by_sql(sql)
     end
+   
+   def self.tagged_with_any(*tag_list)
+     options = tag_list.last.is_a?(Hash) ? tag_list.pop : {}
+     tag_list = parse_tags(tag_list)
+   
+     scope = scope(:find)
+     options[:select] ||= &quot;#{table_name}.*&quot;
+     options[:from] ||= &quot;#{table_name}, tags, taggings&quot;
+   
+     sql  = &quot;SELECT #{(scope &amp;&amp; scope[:select]) || options[:select]} &quot;
+     sql &lt;&lt; &quot;FROM #{(scope &amp;&amp; scope[:from]) || options[:from]} &quot;
+
+     add_joins!(sql, options, scope)
+   
+     sql &lt;&lt; &quot;WHERE #{table_name}.#{primary_key} = taggings.taggable_id &quot;
+     sql &lt;&lt; &quot;AND taggings.taggable_type = '#{ActiveRecord::Base.send(:class_name_of_active_record_descendant, self).to_s}' &quot;
+     sql &lt;&lt; &quot;AND taggings.tag_id = tags.id &quot;
+     
+     sql &lt;&lt; &quot;AND (&quot;
+     or_options = []
+     tag_list.each do |name|
+       or_options &lt;&lt; &quot;tags.name = '#{name}'&quot;
+     end
+     or_options_joined = or_options.join(&quot; OR &quot;)
+     sql &lt;&lt; &quot;#{or_options_joined}) &quot;
+     
+     
+     sql &lt;&lt; &quot;AND #{sanitize_sql(options[:conditions])} &quot; if options[:conditions]
+      
+     columns = column_names.map do |column| 
+       &quot;#{table_name}.#{column}&quot;
+     end.join(&quot;, &quot;)
+      
+     sql &lt;&lt; &quot;GROUP BY #{columns} &quot;
+   
+     add_order!(sql, options[:order], scope)
+     add_limit!(sql, options, scope)
+     add_lock!(sql, options, scope)
+   
+     find_by_sql(sql)
+   end
     
     def parse_tags(tags)
       return [] if tags.blank?</diff>
      <filename>vendor/plugins/has_many_polymorphs/generators/tagging/templates/tagging_extensions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 require File.dirname(__FILE__) + '/../test_helper'
 
-class TaggingTest &lt; Test::Unit::TestCase
+class TaggingTest &lt; ActiveSupport::TestCase
   fixtures :tags, :taggings, &lt;%= taggable_models[0..1].join(&quot;, &quot;) -%&gt;
 
   def setup
@@ -45,15 +45,15 @@ class TaggingTest &lt; Test::Unit::TestCase
 &lt;% if options[:self_referential] -%&gt;  
   def test_self_referential_tag_with
     @tag1.tag_with [1, 2]
-    assert @tag1.tags.include?(@tag1)
-    assert !@tag2.tags.include?(@tag1)
+    assert @tag1.tags.any? {|obj| obj == @tag1}
+    assert !@tag2.tags.any? {|obj| obj == @tag1}
   end
 
 &lt;% end -%&gt;
   def test__add_tags
     @obj1._add_tags &quot;porter longneck&quot;
-    assert Tag.find_by_name(&quot;porter&quot;).taggables.include?(@obj1)
-    assert Tag.find_by_name(&quot;longneck&quot;).taggables.include?(@obj1)
+    assert Tag.find_by_name(&quot;porter&quot;).taggables.any? {|obj| obj == @obj1}
+    assert Tag.find_by_name(&quot;longneck&quot;).taggables.any? {|obj| obj == @obj1}
     assert_equal &quot;longneck pale porter&quot;, @obj1.tag_list    
     
     @obj1._add_tags [2]</diff>
      <filename>vendor/plugins/has_many_polymorphs/generators/tagging/templates/tagging_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,7 +14,7 @@ class ActiveRecord::Base
   extend ActiveRecord::Associations::PolymorphicClassMethods 
 end
 
-if ENV['HMP_DEBUG'] or ENV['RAILS_ENV'] =~ /development|test/ and ENV['USER'] == 'eweaver'
+if ENV['HMP_DEBUG'] || ENV['RAILS_ENV'] =~ /development|test/ &amp;&amp; ENV['USER'] == 'eweaver'
   require 'has_many_polymorphs/debugging_tools' 
 end
 </diff>
      <filename>vendor/plugins/has_many_polymorphs/lib/has_many_polymorphs.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,11 +22,7 @@ module ActiveRecord #:nodoc:
         @reflection.klass.transaction do
           flatten_deeper(records).each do |record|
             if @owner.new_record? or not record.respond_to?(:new_record?) or record.new_record?
-              unless @owner.valid?
-                raise PolymorphicError, &quot;Invalid tag: #{@owner.name} - #{@owner.errors.full_messages}&quot;
-              else
-                raise PolymorphicError, &quot;You can't associate unsaved records.&quot;
-              end
+              raise PolymorphicError, &quot;You can't associate unsaved records.&quot;            
             end
             next if @reflection.options[:skip_duplicates] and @target.include? record
             @owner.send(@reflection.through_reflection.name).proxy_target &lt;&lt; @reflection.klass.create!(construct_join_attributes(record))
@@ -92,18 +88,19 @@ module ActiveRecord #:nodoc:
       def construct_quoted_owner_attributes(*args) #:nodoc:
         # no access to returning() here? why not?
         type_key = @reflection.options[:foreign_type_key]
-        {@reflection.primary_key_name =&gt; @owner.id,
-          type_key=&gt; (@owner.class.base_class.name if type_key)}
+        h = {@reflection.primary_key_name =&gt; @owner.id}
+        h[type_key] = @owner.class.base_class.name if type_key
+        h
       end
 
       def construct_from #:nodoc:
         # build the FROM part of the query, in this case, the polymorphic join table
-        @reflection.klass.table_name
+        @reflection.klass.quoted_table_name
       end
 
       def construct_owner #:nodoc:
         # the table name for the owner object's class
-        @owner.class.table_name
+        @owner.class.quoted_table_name
       end
       
       def construct_owner_key #:nodoc:
@@ -118,10 +115,10 @@ module ActiveRecord #:nodoc:
 
       def construct_joins(custom_joins = nil) #:nodoc:
         # build the string of default joins
-        &quot;JOIN #{construct_owner} polymorphic_parent ON #{construct_from}.#{@reflection.options[:foreign_key]} = polymorphic_parent.#{construct_owner_key} &quot; + 
+        &quot;JOIN #{construct_owner} AS polymorphic_parent ON #{construct_from}.#{@reflection.options[:foreign_key]} = polymorphic_parent.#{construct_owner_key} &quot; + 
         @reflection.options[:from].map do |plural|
           klass = plural._as_class
-          &quot;LEFT JOIN #{klass.table_name} ON #{construct_from}.#{@reflection.options[:polymorphic_key]} = #{klass.table_name}.#{klass.primary_key} AND #{construct_from}.#{@reflection.options[:polymorphic_type_key]} = #{@reflection.klass.quote_value(klass.base_class.name)}&quot;
+          &quot;LEFT JOIN #{klass.quoted_table_name} ON #{construct_from}.#{@reflection.options[:polymorphic_key]} = #{klass.quoted_table_name}.#{klass.primary_key} AND #{construct_from}.#{@reflection.options[:polymorphic_type_key]} = #{@reflection.klass.quote_value(klass.base_class.name)}&quot;
         end.uniq.join(&quot; &quot;) + &quot; #{custom_joins}&quot;
       end
 </diff>
      <filename>vendor/plugins/has_many_polymorphs/lib/has_many_polymorphs/association.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,5 @@
-
 require 'initializer' unless defined? ::Rails::Initializer 
-require 'dispatcher' unless defined? ::ActionController::Dispatcher
+require 'action_controller/dispatcher' unless defined? ::ActionController::Dispatcher
 
 module HasManyPolymorphs
 
@@ -37,7 +36,7 @@ Note that you can override DEFAULT_OPTIONS via Rails::Configuration#has_many_pol
       require requirement
     end
   
-    Dir[options[:file_pattern]].each do |filename|
+    Dir.glob(options[:file_pattern]).each do |filename|
       next if filename =~ /#{options[:file_exclusions].join(&quot;|&quot;)}/
       open filename do |file|
         if file.grep(/#{options[:methods].join(&quot;|&quot;)}/).any?
@@ -64,7 +63,7 @@ class Rails::Initializer #:nodoc:
   alias_method_chain :after_initialize, :autoload 
 end
 
-Dispatcher.to_prepare(:has_many_polymorphs_autoload) do
+ActionController::Dispatcher.to_prepare(:has_many_polymorphs_autoload) do
   # Make sure it gets loaded in the app
   HasManyPolymorphs.autoload
 end</diff>
      <filename>vendor/plugins/has_many_polymorphs/lib/has_many_polymorphs/autoload.rb</filename>
    </modified>
    <modified>
      <diff>@@ -360,10 +360,14 @@ Be aware, however, that &lt;tt&gt;NULL != 'Spot'&lt;/tt&gt; returns &lt;tt&gt;false&lt;/tt&gt; due to SQ
             begin
               table = plural._as_class.table_name
             rescue NameError =&gt; e
-              raise PolymorphicError, &quot;Could not find a valid class for #{plural.inspect}. If it's namespaced, be sure to specify it as :\&quot;module/#{plural}\&quot; instead.&quot;
+              raise PolymorphicError, &quot;Could not find a valid class for #{plural.inspect} (tried #{plural.to_s._classify}). If it's namespaced, be sure to specify it as :\&quot;module/#{plural}\&quot; instead.&quot;
             end
-            plural._as_class.columns.map(&amp;:name).each_with_index do |field, f_index|
-              aliases[&quot;#{table}.#{field}&quot;] = &quot;t#{t_index}_r#{f_index}&quot;
+            begin
+              plural._as_class.columns.map(&amp;:name).each_with_index do |field, f_index|
+                aliases[&quot;#{table}.#{field}&quot;] = &quot;t#{t_index}_r#{f_index}&quot;
+              end
+            rescue ActiveRecord::StatementInvalid =&gt; e
+              _logger_warn &quot;Looks like your table doesn't exist for #{plural.to_s._classify}.\nError #{e}\nSkipping...&quot;
             end
           end
         end
@@ -394,7 +398,7 @@ Be aware, however, that &lt;tt&gt;NULL != 'Spot'&lt;/tt&gt; returns &lt;tt&gt;false&lt;/tt&gt; due to SQ
           }
           
         if reflection.options[:foreign_type_key]         
-          type_check = &quot;#{reflection.options[:foreign_type_key]} = #{quote_value(self.base_class.name)}&quot;
+          type_check = &quot;#{reflection.options[:join_class_name].constantize.quoted_table_name}.#{reflection.options[:foreign_type_key]} = #{quote_value(self.base_class.name)}&quot;
           conjunction = options[:conditions] ? &quot; AND &quot; : nil
           options[:conditions] = &quot;#{options[:conditions]}#{conjunction}#{type_check}&quot;
           options[:as] = reflection.options[:as]</diff>
      <filename>vendor/plugins/has_many_polymorphs/lib/has_many_polymorphs/class_methods.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,11 +8,8 @@ module ActiveRecord #:nodoc:
       def create_reflection(macro, name, options, active_record)
         case macro
           when :has_many, :belongs_to, :has_one, :has_and_belongs_to_many
-          reflection = AssociationReflection.new(macro, name, options, active_record)
-          #the following lines are only compatible with rails 2.2
-          #klass = options[:through] ? ThroughReflection :
-          AssociationReflection
-          #reflection = klass.new(macro, name, options, active_record)
+            klass = options[:through] ? ThroughReflection : AssociationReflection
+            reflection = klass.new(macro, name, options, active_record)
           when :composed_of
             reflection = AggregateReflection.new(macro, name, options, active_record)
           # added by has_many_polymorphs #
@@ -36,7 +33,7 @@ Inherits from ActiveRecord::Reflection::AssociationReflection.
 
 =end
 
-    class PolymorphicReflection &lt; AssociationReflection
+    class PolymorphicReflection &lt; ThroughReflection
       # Stub out the validity check. Has_many_polymorphs checks validity on macro creation, not on reflection.
       def check_validity! 
         # nothing</diff>
      <filename>vendor/plugins/has_many_polymorphs/lib/has_many_polymorphs/reflection.rb</filename>
    </modified>
    <modified>
      <diff>@@ -45,9 +45,13 @@ class Hash
 
   # An implementation of select that returns a Hash.
   def _select
-    Hash[*self.select do |key, value|
-      yield key, value
-    end._flatten_once]
+    if RUBY_VERSION &gt;= &quot;1.9&quot;
+      Hash[*self.select {|k, v| yield k, v }.flatten]
+    else
+      Hash[*self.select do |key, value|
+        yield key, value
+      end._flatten_once]
+    end
   end
 end
 </diff>
      <filename>vendor/plugins/has_many_polymorphs/lib/has_many_polymorphs/support_methods.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 require 'fileutils'
 require File.dirname(__FILE__) + '/../test_helper'
 
-class TaggingGeneratorTest &lt; Test::Unit::TestCase
+class TaggingGeneratorTest &lt; ActiveSupport::TestCase
   
   def setup
     Dir.chdir RAILS_ROOT do</diff>
      <filename>vendor/plugins/has_many_polymorphs/test/generator/tagging_generator_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,6 +3,7 @@ config.cache_classes = ENV['PRODUCTION']
 config.whiny_nils = true
 config.action_controller.consider_all_requests_local = !ENV['PRODUCTION']
 config.action_controller.perform_caching = ENV['PRODUCTION']
-config.action_view.cache_template_extensions = ENV['PRODUCTION']
+# The following has been deprecated in Rails 2.1 and removed in 2.2
+config.action_view.cache_template_extensions = ENV['PRODUCTION'] if Rails::VERSION::MAJOR &lt; 2 or Rails::VERSION::MAJOR == 2 &amp;&amp; Rails::VERSION::MINOR &lt; 1
 config.action_view.debug_rjs = !ENV['PRODUCTION']
 config.action_mailer.raise_delivery_errors = false</diff>
      <filename>vendor/plugins/has_many_polymorphs/test/integration/app/config/environments/development.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 require File.dirname(__FILE__) + '/../test_helper'
 require 'fileutils'
 
-class CommentingGeneratorTest &lt; Test::Unit::TestCase
+class CommentingGeneratorTest &lt; ActiveSupport::TestCase
 
   def test_ensure_comments_dont_exist
     # make sure the comments are already defined</diff>
      <filename>vendor/plugins/has_many_polymorphs/test/integration/app/generators/commenting_generator_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ require 'addresses_controller'
 # Re-raise errors caught by the controller.
 class AddressesController; def rescue_action(e) raise e end; end
 
-class AddressesControllerTest &lt; Test::Unit::TestCase
+class AddressesControllerTest &lt; ActiveSupport::TestCase
   fixtures :addresses
 
   def setup</diff>
      <filename>vendor/plugins/has_many_polymorphs/test/integration/app/test/functional/addresses_controller_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ require 'sellers_controller'
 # Re-raise errors caught by the controller.
 class SellersController; def rescue_action(e) raise e end; end
 
-class SellersControllerTest &lt; Test::Unit::TestCase
+class SellersControllerTest &lt; ActiveSupport::TestCase
   fixtures :sellers
 
   def setup</diff>
      <filename>vendor/plugins/has_many_polymorphs/test/integration/app/test/functional/sellers_controller_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ require 'states_controller'
 # Re-raise errors caught by the controller.
 class StatesController; def rescue_action(e) raise e end; end
 
-class StatesControllerTest &lt; Test::Unit::TestCase
+class StatesControllerTest &lt; ActiveSupport::TestCase
   fixtures :states
 
   def setup</diff>
      <filename>vendor/plugins/has_many_polymorphs/test/integration/app/test/functional/states_controller_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ require 'users_controller'
 # Re-raise errors caught by the controller.
 class UsersController; def rescue_action(e) raise e end; end
 
-class UsersControllerTest &lt; Test::Unit::TestCase
+class UsersControllerTest &lt; ActiveSupport::TestCase
   fixtures :users
 
   def setup</diff>
      <filename>vendor/plugins/has_many_polymorphs/test/integration/app/test/functional/users_controller_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@ ENV[&quot;RAILS_ENV&quot;] = &quot;development&quot;
 require File.expand_path(File.dirname(__FILE__) + &quot;/../config/environment&quot;)
 require 'test_help'
 
-class Test::Unit::TestCase
+class ActiveSupport::TestCase
   self.use_transactional_fixtures = true
   self.use_instantiated_fixtures  = false
 end</diff>
      <filename>vendor/plugins/has_many_polymorphs/test/integration/app/test/test_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 require File.dirname(__FILE__) + '/../test_helper'
 
-class BoneTest &lt; Test::Unit::TestCase
+class BoneTest &lt; ActiveSupport::TestCase
   # Replace this with your real tests.
   def test_truth
     assert true</diff>
      <filename>vendor/plugins/has_many_polymorphs/test/integration/app/test/unit/bone_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 require File.dirname(__FILE__) + '/../test_helper'
 
-class DoubleStiParentRelationshipTest &lt; Test::Unit::TestCase
+class DoubleStiParentRelationshipTest &lt; ActiveSupport::TestCase
   # Replace this with your real tests.
   def test_truth
     assert true</diff>
      <filename>vendor/plugins/has_many_polymorphs/test/integration/app/test/unit/double_sti_parent_relationship_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 require File.dirname(__FILE__) + '/../test_helper'
 
-class DoubleStiParentTest &lt; Test::Unit::TestCase
+class DoubleStiParentTest &lt; ActiveSupport::TestCase
   # Replace this with your real tests.
   def test_truth
     assert true</diff>
      <filename>vendor/plugins/has_many_polymorphs/test/integration/app/test/unit/double_sti_parent_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 require File.dirname(__FILE__) + '/../test_helper'
 
-class OrganicSubstanceTest &lt; Test::Unit::TestCase
+class OrganicSubstanceTest &lt; ActiveSupport::TestCase
   # Replace this with your real tests.
   def test_truth
     assert true</diff>
      <filename>vendor/plugins/has_many_polymorphs/test/integration/app/test/unit/organic_substance_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 require File.dirname(__FILE__) + '/../test_helper'
 
-class SingleStiParentRelationshipTest &lt; Test::Unit::TestCase
+class SingleStiParentRelationshipTest &lt; ActiveSupport::TestCase
   # Replace this with your real tests.
   def test_truth
     assert true</diff>
      <filename>vendor/plugins/has_many_polymorphs/test/integration/app/test/unit/single_sti_parent_relationship_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 require File.dirname(__FILE__) + '/../test_helper'
 
-class SingleStiParentTest &lt; Test::Unit::TestCase
+class SingleStiParentTest &lt; ActiveSupport::TestCase
   # Replace this with your real tests.
   def test_truth
     assert true</diff>
      <filename>vendor/plugins/has_many_polymorphs/test/integration/app/test/unit/single_sti_parent_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 require File.dirname(__FILE__) + '/../test_helper'
 
-class StickTest &lt; Test::Unit::TestCase
+class StickTest &lt; ActiveSupport::TestCase
   # Replace this with your real tests.
   def test_truth
     assert true</diff>
      <filename>vendor/plugins/has_many_polymorphs/test/integration/app/test/unit/stick_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 require File.dirname(__FILE__) + '/../test_helper'
 
-class StoneTest &lt; Test::Unit::TestCase
+class StoneTest &lt; ActiveSupport::TestCase
   # Replace this with your real tests.
   def test_truth
     assert true</diff>
      <filename>vendor/plugins/has_many_polymorphs/test/integration/app/test/unit/stone_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ require 'open-uri'
 
 # Start the server
 
-class ServerTest &lt; Test::Unit::TestCase
+class ServerTest &lt; ActiveSupport::TestCase
 
   PORT = 43040
   URL = &quot;http://localhost:#{PORT}/&quot;
@@ -40,4 +40,4 @@ class ServerTest &lt; Test::Unit::TestCase
     # XXX Probably can use script/runner to test this
   end
   
-end
\ No newline at end of file
+end</diff>
      <filename>vendor/plugins/has_many_polymorphs/test/integration/server_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,8 +3,6 @@ class EatersFoodstuff &lt; ActiveRecord::Base
   belongs_to :foodstuff, :class_name =&gt; &quot;Petfood&quot;, :foreign_key =&gt; &quot;foodstuff_id&quot;
   belongs_to :eater, :polymorphic =&gt; true
   
-  def before_save
-    self.some_attribute = 3
-  end
+  before_save { |record| record.some_attribute = 3 }
 end
 </diff>
      <filename>vendor/plugins/has_many_polymorphs/test/models/eaters_foodstuff.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,8 +6,8 @@ Dir.chdir &quot;#{File.dirname(__FILE__)}/integration/app/&quot; do
     system(&quot;rm has_many_polymorphs; ln -s ../../../../../ has_many_polymorphs&quot;)
   end
 
-  system &quot;rake db:drop --trace RAILS_GEM_VERSION=2.0.2 &quot;
-  system &quot;rake db:create --trace RAILS_GEM_VERSION=2.0.2 &quot;
+  system &quot;rake db:drop   --trace RAILS_GEM_VERSION=2.2.2 &quot;
+  system &quot;rake db:create --trace RAILS_GEM_VERSION=2.2.2 &quot;
   system &quot;rake db:migrate --trace&quot;
   system &quot;rake db:fixtures:load --trace&quot;  
 end</diff>
      <filename>vendor/plugins/has_many_polymorphs/test/setup.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,11 @@
 
 $VERBOSE = nil
 require 'rubygems'
+require 'rake' # echoe relies on Rake being present but doesn't require it itself
 require 'echoe'
 require 'test/unit'
 require 'multi_rails_init'
-require 'ruby-debug'
+#require 'ruby-debug' # uncomment if needed (for Ruby &gt;= 1.9 use require 'debug' where needed)
 
 if defined? ENV['MULTIRAILS_RAILS_VERSION']
   ENV['RAILS_GEM_VERSION'] = ENV['MULTIRAILS_RAILS_VERSION']
@@ -23,13 +24,13 @@ LOG = &quot;#{HERE}/integration/app/log/development.log&quot;
 require 'integration/app/config/environment'
 require 'test_help'
 
-Inflector.inflections {|i| i.irregular 'fish', 'fish' }
+ActiveSupport::Inflector.inflections {|i| i.irregular 'fish', 'fish' }
 
-$LOAD_PATH.unshift(Test::Unit::TestCase.fixture_path = HERE + &quot;/fixtures&quot;)
+$LOAD_PATH.unshift(ActiveSupport::TestCase.fixture_path = HERE + &quot;/fixtures&quot;)
 $LOAD_PATH.unshift(HERE + &quot;/models&quot;)
 $LOAD_PATH.unshift(HERE + &quot;/modules&quot;)
 
-class Test::Unit::TestCase
+class ActiveSupport::TestCase
   self.use_transactional_fixtures = !(ActiveRecord::Base.connection.is_a? ActiveRecord::ConnectionAdapters::MysqlAdapter rescue false)
   self.use_instantiated_fixtures  = false
 end</diff>
      <filename>vendor/plugins/has_many_polymorphs/test/test_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,7 +10,7 @@ require 'aquatic/fish'
 require 'aquatic/pupils_whale'
 require 'beautiful_fight_relationship' 
 
-class PolymorphTest &lt; Test::Unit::TestCase
+class PolymorphTest &lt; ActiveSupport::TestCase
   
   set_fixture_class :bow_wows =&gt; Dog
   set_fixture_class :keep_your_enemies_close =&gt; BeautifulFightRelationship
@@ -76,7 +76,7 @@ class PolymorphTest &lt; Test::Unit::TestCase
   def test_duplicate_assignment
     # try to add a duplicate item when :ignore_duplicates is false
     @kibbles.eaters.push(@alice)
-    assert @kibbles.eaters.include?(@alice)
+    assert @kibbles.eaters.any? {|obj| obj == @alice}
     @kibbles.eaters.push(@alice)
     assert_equal @kibbles_eaters_count + 2, @kibbles.eaters.count
     assert_equal @join_count + 2, EatersFoodstuff.count
@@ -114,7 +114,7 @@ class PolymorphTest &lt; Test::Unit::TestCase
 
     # reload; is the new association there?
     assert @bits.eaters.reload
-    assert @bits.eaters.include?(@chloe)
+    assert @bits.eaters.any? {|obj| obj == @chloe}
   end
 
   def test_build_join_record_on_association
@@ -126,7 +126,7 @@ class PolymorphTest &lt; Test::Unit::TestCase
     assert_equal @join_count + 1, EatersFoodstuff.count
 
     assert @bits.eaters.reload
-    assert @bits.eaters.include?(@chloe)
+    assert @bits.eaters.any? {|obj| obj == @chloe}
   end
 
 #  not supporting this, since has_many :through doesn't support it either  
@@ -145,12 +145,12 @@ class PolymorphTest &lt; Test::Unit::TestCase
   def test_self_reference
     assert @kibbles.eaters &lt;&lt; @bits
     assert_equal @kibbles_eaters_count += 1, @kibbles.eaters.count
-    assert @kibbles.eaters.include?(@bits)
+    assert @kibbles.eaters.any? {|obj| obj == @bits}
     @kibbles.reload
     assert @kibbles.foodstuffs_of_eaters.blank?
     
     @bits.reload
-    assert @bits.foodstuffs_of_eaters.include?(@kibbles)
+    assert @bits.foodstuffs_of_eaters.any? {|obj| obj == @kibbles}
     assert_equal [@kibbles], @bits.foodstuffs_of_eaters
   end
 
@@ -190,9 +190,9 @@ class PolymorphTest &lt; Test::Unit::TestCase
   def test_individual_collections_push
     assert_equal [@chloe], (@kibbles.eater_kittens &lt;&lt; @chloe)
     @kibbles.reload
-    assert @kibbles.eaters.include?(@chloe)
-    assert @kibbles.eater_kittens.include?(@chloe)
-    assert !@kibbles.eater_dogs.include?(@chloe)
+    assert @kibbles.eaters.any? {|obj| obj == @chloe}
+    assert @kibbles.eater_kittens.any? {|obj| obj == @chloe}
+    assert !@kibbles.eater_dogs.any? {|obj| obj == @chloe}
   end
 
   def test_individual_collections_delete
@@ -204,7 +204,7 @@ class PolymorphTest &lt; Test::Unit::TestCase
     
     @kibbles.reload    
     assert @kibbles.eater_kittens.empty?
-    assert @kibbles.eater_dogs.include?(@spot)
+    assert @kibbles.eater_dogs.any? {|obj| obj == @spot}
   end
   
   def test_individual_collections_clear
@@ -217,14 +217,14 @@ class PolymorphTest &lt; Test::Unit::TestCase
 
     assert @kibbles.eater_kittens.empty?    
     assert_equal 2, @kibbles.eaters.size
-    assert !@kibbles.eater_kittens.include?(@chloe)
-    assert !@kibbles.eaters.include?(@chloe)
+    assert !@kibbles.eater_kittens.any? {|obj| obj == @chloe}
+    assert !@kibbles.eaters.any? {|obj| obj == @chloe}
 
     @kibbles.reload    
     assert @kibbles.eater_kittens.empty?    
     assert_equal 2, @kibbles.eaters.size
-    assert !@kibbles.eater_kittens.include?(@chloe)
-    assert !@kibbles.eaters.include?(@chloe)
+    assert !@kibbles.eater_kittens.any? {|obj| obj == @chloe}
+    assert !@kibbles.eaters.any? {|obj| obj == @chloe}
   end
   
   def test_childrens_individual_collections
@@ -316,13 +316,13 @@ class PolymorphTest &lt; Test::Unit::TestCase
 
   def test_namespaced_polymorphic_collection
     @shamu.aquatic_pupils &lt;&lt; @swimmy
-    assert @shamu.aquatic_pupils.include?(@swimmy)
+    assert @shamu.aquatic_pupils.any? {|obj| obj == @swimmy}
     @shamu.reload
-    assert @shamu.aquatic_pupils.include?(@swimmy)
+    assert @shamu.aquatic_pupils.any? {|obj| obj == @swimmy}
 
     @shamu.aquatic_pupils &lt;&lt; @spot
-    assert @shamu.dogs.include?(@spot)
-    assert @shamu.aquatic_pupils.include?(@swimmy)
+    assert @shamu.dogs.any? {|obj| obj == @spot}
+    assert @shamu.aquatic_pupils.any? {|obj| obj == @swimmy}
     assert_equal @swimmy, @shamu.aquatic_fish.first
     assert_equal 10, @shamu.aquatic_fish.first.speed
   end
@@ -333,8 +333,8 @@ class PolymorphTest &lt; Test::Unit::TestCase
     
     @shamu.reload
     @shamu.aquatic_pupils.delete @spot
-    assert !@shamu.dogs.include?(@spot)
-    assert !@shamu.aquatic_pupils.include?(@spot)
+    assert !@shamu.dogs.any? {|obj| obj == @spot}
+    assert !@shamu.aquatic_pupils.any? {|obj| obj == @spot}
     assert_equal 1, @shamu.aquatic_pupils.length
   end
   
@@ -357,9 +357,9 @@ class PolymorphTest &lt; Test::Unit::TestCase
     @alice.enemies &lt;&lt; @spot
     @alice.reload
     @spot.reload
-    assert @spot.protectors.include?(@alice)
-    assert @alice.enemies.include?(@spot)
-    assert !@alice.protectors.include?(@alice)
+    assert @spot.protectors.any? {|obj| obj == @alice}
+    assert @alice.enemies.any? {|obj| obj == @spot}
+    assert !@alice.protectors.any? {|obj| obj == @alice}
     assert_equal 1, @alice.beautiful_fight_relationships_as_protector.size
     assert_equal 0, @alice.beautiful_fight_relationships_as_enemy.size
     assert_equal 1, @alice.beautiful_fight_relationships.size
@@ -367,7 +367,7 @@ class PolymorphTest &lt; Test::Unit::TestCase
     # self reference
     assert_equal 1, @alice.enemies.length
     @alice.enemies.push @alice
-    assert @alice.enemies.include?(@alice)
+    assert @alice.enemies.any? {|obj| obj == @alice}
     assert_equal 2, @alice.enemies.length    
     @alice.reload
     assert_equal 2, @alice.beautiful_fight_relationships_as_protector.size
@@ -386,7 +386,7 @@ class PolymorphTest &lt; Test::Unit::TestCase
     assert_equal @double_join_count + 1, BeautifulFightRelationship.count
 
     assert @alice.enemies.reload
-    assert @alice.enemies.include?(@spot)
+    assert @alice.enemies.any? {|obj| obj == @spot}
   end
   
   def test_double_dependency_injection
@@ -396,12 +396,12 @@ class PolymorphTest &lt; Test::Unit::TestCase
   def test_double_collection_deletion
     @alice.enemies &lt;&lt; @spot
     @alice.reload
-    assert @alice.enemies.include?(@spot)
+    assert @alice.enemies.any? {|obj| obj == @spot}
     @alice.enemies.delete(@spot)
-    assert !@alice.enemies.include?(@spot)
+    assert !@alice.enemies.any? {|obj| obj == @spot}
     assert @alice.enemies.empty?
     @alice.reload
-    assert !@alice.enemies.include?(@spot)
+    assert !@alice.enemies.any? {|obj| obj == @spot}
     assert @alice.enemies.empty?
     assert_equal 0, @alice.beautiful_fight_relationships.size
   end
@@ -409,12 +409,12 @@ class PolymorphTest &lt; Test::Unit::TestCase
   def test_double_collection_deletion_from_opposite_side
     @alice.protectors &lt;&lt; @puma
     @alice.reload
-    assert @alice.protectors.include?(@puma)
+    assert @alice.protectors.any? {|obj| obj == @puma}
     @alice.protectors.delete(@puma)
-    assert !@alice.protectors.include?(@puma)
+    assert !@alice.protectors.any? {|obj| obj == @puma}
     assert @alice.protectors.empty?
     @alice.reload
-    assert !@alice.protectors.include?(@puma)
+    assert !@alice.protectors.any? {|obj| obj == @puma}
     assert @alice.protectors.empty?
     assert_equal 0, @alice.beautiful_fight_relationships.size
   end
@@ -423,59 +423,58 @@ class PolymorphTest &lt; Test::Unit::TestCase
     assert @alice.dogs.empty?
     @alice.enemies &lt;&lt; @spot
 
-    assert @alice.enemies.include?(@spot)
-    assert !@alice.kittens.include?(@alice)    
+    assert @alice.enemies.any? {|obj| obj == @spot}
+    assert !@alice.kittens.any? {|obj| obj == @alice}    
 
-    assert !@alice.dogs.include?(@spot)    
+    assert !@alice.dogs.any? {|obj| obj == @spot}    
     @alice.reload
-    assert @alice.dogs.include?(@spot)    
-    assert !WildBoar.find(@alice.id).dogs.include?(@spot) # make sure the parent type is checked
+    assert @alice.dogs.any? {|obj| obj == @spot}    
+    assert !WildBoar.find(@alice.id).dogs.any? {|obj| obj == @spot} # make sure the parent type is checked
   end
 
   def test_individual_collections_created_for_double_relationship_from_opposite_side
     assert @alice.wild_boars.empty?
     @alice.protectors &lt;&lt; @puma
-
-    assert @alice.protectors.include?(@puma)
-    assert !@alice.wild_boars.include?(@puma)    
     @alice.reload
-    assert @alice.wild_boars.include?(@puma)    
+
+    assert @alice.protectors.any? {|obj| obj == @puma}
+    assert @alice.wild_boars.any? {|obj| obj == @puma}    
     
-    assert !Dog.find(@alice.id).wild_boars.include?(@puma) # make sure the parent type is checked
+    assert !Dog.find(@alice.id).wild_boars.any? {|obj| obj == @puma} # make sure the parent type is checked
   end
   
   def test_self_referential_individual_collections_created_for_double_relationship
     @alice.enemies &lt;&lt; @alice
     @alice.reload
-    assert @alice.enemy_kittens.include?(@alice)
-    assert @alice.protector_kittens.include?(@alice)
-    assert @alice.kittens.include?(@alice)
+    assert @alice.enemy_kittens.any? {|obj| obj == @alice}
+    assert @alice.protector_kittens.any? {|obj| obj == @alice}
+    assert @alice.kittens.any? {|obj| obj == @alice}
     assert_equal 2, @alice.kittens.size
 
     @alice.enemies &lt;&lt; (@chloe =  Kitten.find_by_name('Chloe'))
     @alice.reload
-    assert @alice.enemy_kittens.include?(@chloe)
-    assert !@alice.protector_kittens.include?(@chloe)
-    assert @alice.kittens.include?(@chloe)
+    assert @alice.enemy_kittens.any? {|obj| obj == @chloe}
+    assert !@alice.protector_kittens.any? {|obj| obj == @chloe}
+    assert @alice.kittens.any? {|obj| obj == @chloe}
     assert_equal 3, @alice.kittens.size    
   end
     
   def test_child_of_polymorphic_join_can_reach_parent
     @alice.enemies &lt;&lt; @spot    
     @alice.reload
-    assert @spot.protectors.include?(@alice)
+    assert @spot.protectors.any? {|obj| obj == @alice}
   end
   
   def test_double_collection_deletion_from_child_polymorphic_join
     @alice.enemies &lt;&lt; @spot
     @spot.protectors.delete(@alice)
-    assert !@spot.protectors.include?(@alice)
+    assert !@spot.protectors.any? {|obj| obj == @alice}
     @alice.reload
-    assert !@alice.enemies.include?(@spot)
+    assert !@alice.enemies.any? {|obj| obj == @spot}
     BeautifulFightRelationship.create(:protector_id =&gt; 2, :protector_type =&gt; &quot;Dog&quot;, :enemy_id =&gt; @spot.id, :enemy_type =&gt; @spot.class.name)
     @alice.enemies &lt;&lt; @spot
     @spot.protectors.delete(@alice)
-    assert !@spot.protectors.include?(@alice)
+    assert !@spot.protectors.any? {|obj| obj == @alice}
   end
 
   def test_collection_query_on_unsaved_record
@@ -486,15 +485,15 @@ class PolymorphTest &lt; Test::Unit::TestCase
   def test_double_individual_collections_push
     assert_equal [@chloe], (@spot.protector_kittens &lt;&lt; @chloe)
     @spot.reload
-    assert @spot.protectors.include?(@chloe)
-    assert @spot.protector_kittens.include?(@chloe)
-    assert !@spot.protector_dogs.include?(@chloe)
+    assert @spot.protectors.any? {|obj| obj == @chloe}
+    assert @spot.protector_kittens.any? {|obj| obj == @chloe}
+    assert !@spot.protector_dogs.any? {|obj| obj == @chloe}
  
     assert_equal [@froggy], (@spot.frogs &lt;&lt; @froggy)
     @spot.reload
-    assert @spot.enemies.include?(@froggy)
-    assert @spot.frogs.include?(@froggy)
-    assert !@spot.enemy_dogs.include?(@froggy)
+    assert @spot.enemies.any? {|obj| obj == @froggy}
+    assert @spot.frogs.any? {|obj| obj == @froggy}
+    assert !@spot.enemy_dogs.any? {|obj| obj == @froggy}
   end
 
   def test_double_individual_collections_delete
@@ -506,7 +505,7 @@ class PolymorphTest &lt; Test::Unit::TestCase
     
     @spot.reload    
     assert @spot.protector_kittens.empty?
-    assert @spot.wild_boars.include?(@puma)
+    assert @spot.wild_boars.any? {|obj| obj == @puma}
   end
   
   def test_double_individual_collections_clear
@@ -518,12 +517,12 @@ class PolymorphTest &lt; Test::Unit::TestCase
     @spot.reload    
     assert @spot.protector_kittens.empty?    
     assert_equal 1, @spot.protectors.size
-    assert !@spot.protector_kittens.include?(@chloe)
-    assert !@spot.protectors.include?(@chloe)
-    assert !@spot.protector_kittens.include?(@alice)
-    assert !@spot.protectors.include?(@alice)
-    assert @spot.protectors.include?(@puma)
-    assert @spot.wild_boars.include?(@puma)
+    assert !@spot.protector_kittens.any? {|obj| obj == @chloe}
+    assert !@spot.protectors.any? {|obj| obj == @chloe}
+    assert !@spot.protector_kittens.any? {|obj| obj == @alice}
+    assert !@spot.protectors.any? {|obj| obj == @alice}
+    assert @spot.protectors.any? {|obj| obj == @puma}
+    assert @spot.wild_boars.any? {|obj| obj == @puma}
   end 
 
   def test_single_extensions</diff>
      <filename>vendor/plugins/has_many_polymorphs/test/unit/has_many_polymorphs_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>0f218a109f5ba2464910cbc494c3a6ef426b6907</id>
    </parent>
  </parents>
  <author>
    <name>Michael Kessler</name>
    <email>michi@netzpiraten.ch</email>
  </author>
  <url>http://github.com/jomz/radiant-tags-extension/commit/7e635af69729197d9cce7a1b74c62332a8321913</url>
  <id>7e635af69729197d9cce7a1b74c62332a8321913</id>
  <committed-date>2009-05-15T15:56:54-07:00</committed-date>
  <authored-date>2009-05-15T15:56:54-07:00</authored-date>
  <message>Updated has_many_polymorphs</message>
  <tree>e70ce38fc32aaa882823abe03f7f22ae11cdb966</tree>
  <committer>
    <name>Michael Kessler</name>
    <email>michi@netzpiraten.ch</email>
  </committer>
</commit>
