<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -57,10 +57,10 @@ module ActiveSupport
         end
       end
 
-      def flush_cache(*syms, &amp;block)
+      def flush_cache(*syms)
         syms.each do |sym|
           (methods + private_methods + protected_methods).each do |m|
-            if m.to_s =~ /^_unmemoized_(#{sym})/
+            if m.to_s =~ /^_unmemoized_(#{sym.to_s.gsub(/\?\Z/, '\?')})/
               ivar = ActiveSupport::Memoizable.memoized_ivar_for($1)
               instance_variable_get(ivar).clear if instance_variable_defined?(ivar)
             end</diff>
      <filename>activesupport/lib/active_support/memoizable.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,12 +4,13 @@ class MemoizableTest &lt; ActiveSupport::TestCase
   class Person
     extend ActiveSupport::Memoizable
 
-    attr_reader :name_calls, :age_calls, :is_developer_calls
+    attr_reader :name_calls, :age_calls, :is_developer_calls, :name_query_calls
 
     def initialize
       @name_calls = 0
       @age_calls = 0
       @is_developer_calls = 0
+      @name_query_calls = 0
     end
 
     def name
@@ -18,6 +19,7 @@ class MemoizableTest &lt; ActiveSupport::TestCase
     end
 
     def name?
+      @name_query_calls += 1
       true
     end
     memoize :name?
@@ -116,6 +118,13 @@ class MemoizableTest &lt; ActiveSupport::TestCase
     end
   end
 
+  def test_memoization_flush_with_punctuation
+    assert_equal true, @person.name?
+    @person.flush_cache(:name?)
+    3.times { assert_equal true, @person.name? }
+    assert_equal 2, @person.name_query_calls
+  end
+
   def test_memoization_with_nil_value
     assert_equal nil, @person.age
     assert_equal 1, @person.age_calls</diff>
      <filename>activesupport/test/memoizable_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e01f99786a586e41a36d3c1ddc66f080d04b4036</id>
    </parent>
  </parents>
  <author>
    <name>Jay Pignata</name>
    <email>john.pignata@gmail.com</email>
  </author>
  <url>http://github.com/rails/rails/commit/d48ebeade2d907573e3fb086495b57b10115066c</url>
  <id>d48ebeade2d907573e3fb086495b57b10115066c</id>
  <committed-date>2009-09-27T18:48:13-07:00</committed-date>
  <authored-date>2009-09-04T14:28:36-07:00</authored-date>
  <message>Escaping symbol passed into Memoizable's flush_cache for query methods to allow them to be cleared

Signed-off-by: Michael Koziarski &lt;michael@koziarski.com&gt;

[#3138 state:committed]</message>
  <tree>c5c98e01f7711c0899201b5a47ebc8e08c2d16f6</tree>
  <committer>
    <name>Michael Koziarski</name>
    <email>michael@koziarski.com</email>
  </committer>
</commit>
