<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -215,7 +215,7 @@ module ActiveRecord::Extensions
     def self.process_without_suffix( key, val, caller )
       return nil unless caller.columns_hash.has_key?( key )
       if val.nil?
-        str = &quot;#{caller.quoted_table_name}.#{caller.connection.quote_column_name( key )} IS NULL&quot;
+        str = &quot;#{caller.quoted_table_name}.#{caller.connection.quote_column_name( key )} is ?&quot;
       else
         str = &quot;#{caller.quoted_table_name}.#{caller.connection.quote_column_name( key )}=?&quot; 
       end</diff>
      <filename>ar-extensions/lib/ar-extensions/extensions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -49,6 +49,7 @@ class ActiveRecord::Base
     
     def sanitize_sql_from_hash( hsh ) #:nodoc:
       conditions, values = [], []
+      hsh = expand_hash_conditions_for_aggregates(hsh) # introduced in Rails 2.0.2
 
       hsh.each_pair do |key,val|
         if val.respond_to?( :to_sql )  </diff>
      <filename>ar-extensions/lib/ar-extensions/finders.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,13 @@
 class Topic &lt; ActiveRecord::Base
   validates_presence_of :author_name
   has_many :books
+  
+  composed_of :description, :mapping =&gt; [ %w(title title), %w(author_name author_name)], :allow_nil =&gt; true, :class_name =&gt; &quot;TopicDescription&quot;
 end
+
+class TopicDescription
+  attr_reader :title, :author_name
+  def initialize(title, author_name)
+    @title, @author_name = title, author_name
+  end
+end
\ No newline at end of file</diff>
      <filename>ar-extensions/tests/models/topic.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,7 @@ class FindersTest &lt; Test::Unit::TestCase
   def setup
     @connection = ActiveRecord::Base.connection
   end
-
+  
   def test_activerecord_model_can_be_used_with_reserved_words
     group1 = Group.create!(:order =&gt; &quot;x&quot;)
     group2 = Group.create!(:order =&gt; &quot;y&quot;)
@@ -28,5 +28,21 @@ class FindersTest &lt; Test::Unit::TestCase
       Group.find(group1.id, :conditions =&gt; { 'group.order' =&gt; &quot;y&quot; }) 
     }
   end
+
+  def test_exists_with_aggregate_having_three_mappings
+    topic = Topic.create! :title =&gt; &quot;SomeBook&quot;, :author_name =&gt; &quot;Joe Smith&quot;
+    assert Topic.exists?(:description =&gt; topic.description)
+
+    topic = Topic.new :title =&gt; &quot;MayDay&quot;, :author_name =&gt; &quot;Joe Smith the 2nd&quot;
+    assert !Topic.exists?(:description =&gt; topic.description)
+  end
+  
+  def test_find_with_aggregate
+    topic = Topic.create! :title =&gt; &quot;SomeBook&quot;, :author_name =&gt; &quot;Joe Smith&quot;
+    assert_equal topic, Topic.find(:first, :conditions =&gt; { :description =&gt; topic.description })
+
+    topic = Topic.new :title =&gt; &quot;MayDay&quot;, :author_name =&gt; &quot;Joe Smith the 2nd&quot;
+    assert !Topic.find(:first, :conditions =&gt; { :description =&gt; topic.description })
+  end
   
 end</diff>
      <filename>ar-extensions/tests/test_activerecord_compatability.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>480ec74067716f4a660f02bd95532355ac6a1152</id>
    </parent>
  </parents>
  <author>
    <name>Zach Dennis</name>
    <email>zach.dennis@gmail.com</email>
  </author>
  <url>http://github.com/zdennis/ar-extensions/commit/75b88587a8e44055f020e1cdc0ee8491a6c5d46e</url>
  <id>75b88587a8e44055f020e1cdc0ee8491a6c5d46e</id>
  <committed-date>2008-07-18T07:27:53-07:00</committed-date>
  <authored-date>2008-07-18T07:27:53-07:00</authored-date>
  <message>* Fixed bug where passing in nil values to a conditions hash was producing the wrong number of bind variables
* Fixed bug where aggregate attributes of a AR model weren't being processed correctly for Rails 2.0.2</message>
  <tree>ef58b0cb03a87af54fc4dd06f852b849225a2408</tree>
  <committer>
    <name>Zach Dennis</name>
    <email>zach.dennis@gmail.com</email>
  </committer>
</commit>
