<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -122,20 +122,24 @@ module DataMapper
 
       def update(repository, resource)
         properties = resource.dirty_attributes
-
-        sql = update_statement(resource.class, properties)
-        values = properties.map { |property| resource.instance_variable_get(property.instance_variable_name) }
-        parameters = (values + resource.key)
-        DataMapper.logger.debug { &quot;UPDATE: #{sql}  PARAMETERS: #{parameters.inspect}&quot; }
-
-        connection = create_connection
-        command = connection.create_command(sql)
-
-        affected_rows = command.execute_non_query(*parameters).to_i
-
-        close_connection(connection)
-
-        affected_rows == 1
+        
+        if properties.empty?
+          return false
+        else
+          sql = update_statement(resource.class, properties)
+          values = properties.map { |property| resource.instance_variable_get(property.instance_variable_name) }
+          parameters = (values + resource.key)
+          DataMapper.logger.debug { &quot;UPDATE: #{sql}  PARAMETERS: #{parameters.inspect}&quot; }
+          
+          connection = create_connection
+          command = connection.create_command(sql)
+          
+          affected_rows = command.execute_non_query(*parameters).to_i
+          
+          close_connection(connection)
+          
+          affected_rows == 1
+        end
       end
 
       def delete(repository, resource)</diff>
      <filename>lib/data_mapper/adapters/data_objects_adapter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -176,6 +176,15 @@ describe DataMapper::Adapters::DataObjectsAdapter::SQL, &quot;creating, reading, upda
     end
   end
 
+  describe &quot;#update&quot; do
+    it 'should not try to update if there are no dirty attributes' do
+      repository = mock(&quot;repository&quot;)
+      resource = mock(&quot;resource&quot;)
+      resource.stub!(:dirty_attributes).and_return({})
+      @adapter.update(repository, resource).should == false
+    end
+  end
+
   describe &quot;#create_statement_with_returning&quot; do
 
     it 'should generate a SQL statement for all fields' do</diff>
      <filename>spec/unit/adapters/data_objects_adapter_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>eeb17029c0020d323dc29aae437d5251f9cd7701</id>
    </parent>
  </parents>
  <author>
    <name>Martin Kihlgren</name>
    <email>zond@cthulhu.rlyeh</email>
  </author>
  <url>http://github.com/wycats/dm-core/commit/e6e61fcc9021a63c638ef86d41fc13c3cd52fc6c</url>
  <id>e6e61fcc9021a63c638ef86d41fc13c3cd52fc6c</id>
  <committed-date>2008-04-17T09:48:52-07:00</committed-date>
  <authored-date>2008-04-17T09:48:52-07:00</authored-date>
  <message>Resolved ticket #210.

 * Made DataObjectsAdapter#update do nothing when no properties
   are updated.</message>
  <tree>b08331eb01a8beb5d26aa11632258024817fe3e6</tree>
  <committer>
    <name>Martin Kihlgren</name>
    <email>zond@cthulhu.rlyeh</email>
  </committer>
</commit>
