<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -3,6 +3,14 @@ require 'memcache'
 module ActiveSupport
   module Cache
     class MemCacheStore &lt; Store
+      module Response
+        STORED      = &quot;STORED\r\n&quot;
+        NOT_STORED  = &quot;NOT_STORED\r\n&quot;
+        EXISTS      = &quot;EXISTS\r\n&quot;
+        NOT_FOUND   = &quot;NOT_FOUND\r\n&quot;
+        DELETED     = &quot;DELETED\r\n&quot;
+      end
+
       attr_reader :addresses
 
       def initialize(*addresses)
@@ -21,22 +29,25 @@ module ActiveSupport
       end
 
       # Set key = value if key isn't already set. Pass :force =&gt; true
-      # to unconditionally set key = value.
+      # to unconditionally set key = value. Returns a boolean indicating
+      # whether the key was set.
       def write(key, value, options = {})
         super
         method = options[:force] ? :set : :add
-        @data.send(method, key, value, expires_in(options), raw?(options))
+        response = @data.send(method, key, value, expires_in(options), raw?(options))
+        response == Response::STORED
       rescue MemCache::MemCacheError =&gt; e
         logger.error(&quot;MemCacheError (#{e}): #{e.message}&quot;)
-        nil
+        false
       end
 
       def delete(key, options = nil)
         super
-        @data.delete(key, expires_in(options))
+        response = @data.delete(key, expires_in(options))
+        response == Response::DELETED
       rescue MemCache::MemCacheError =&gt; e
         logger.error(&quot;MemCacheError (#{e}): #{e.message}&quot;)
-        nil
+        false
       end
 
       def delete_matched(matcher, options = nil)</diff>
      <filename>activesupport/lib/active_support/cache/mem_cache_store.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>09d98f13316c76a61cbceaa4157c45ac4924803c</id>
    </parent>
  </parents>
  <author>
    <name>Jeremy Kemper</name>
    <email>jeremy@bitsweat.net</email>
  </author>
  <url>http://github.com/rails/rails/commit/0d26e47b296e29dc48da1b31949d7b7adfb40553</url>
  <id>0d26e47b296e29dc48da1b31949d7b7adfb40553</id>
  <committed-date>2008-02-01T00:25:58-08:00</committed-date>
  <authored-date>2008-02-01T00:25:58-08:00</authored-date>
  <message>MemCacheStore#write and #delete return a boolean indicating whether the operation succeeded


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8767 5ecf4fe2-1ee6-0310-87b1-e25e094e27de</message>
  <tree>80dcf812d165a03a55513fa27604ffd8f1659096</tree>
  <committer>
    <name>Jeremy Kemper</name>
    <email>jeremy@bitsweat.net</email>
  </committer>
</commit>
