From ae6105ef01b2a767afa2bf5b64c90d288c752995 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sun, 27 Jul 2008 21:45:55 -0700 Subject: Don't rememoize if already frozen --- activesupport/lib/active_support/memoizable.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'activesupport/lib') diff --git a/activesupport/lib/active_support/memoizable.rb b/activesupport/lib/active_support/memoizable.rb index 21636b8af4..23dd96e4df 100644 --- a/activesupport/lib/active_support/memoizable.rb +++ b/activesupport/lib/active_support/memoizable.rb @@ -11,10 +11,9 @@ module ActiveSupport def freeze_with_memoizable methods.each do |method| - if m = method.to_s.match(/^_unmemoized_(.*)/) - send(m[1]) - end - end + __send__($1) if method.to_s =~ /^_unmemoized_(.*)/ + end unless frozen? + freeze_without_memoizable end end -- cgit v1.2.3