aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-07-27 21:45:55 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2008-07-28 13:54:10 -0700
commitae6105ef01b2a767afa2bf5b64c90d288c752995 (patch)
tree0b5e873d61bb82742056547f0ecc69c533858314 /activesupport
parenteb256718c3c1a0640f69861587239f1e6cde2820 (diff)
downloadrails-ae6105ef01b2a767afa2bf5b64c90d288c752995.tar.gz
rails-ae6105ef01b2a767afa2bf5b64c90d288c752995.tar.bz2
rails-ae6105ef01b2a767afa2bf5b64c90d288c752995.zip
Don't rememoize if already frozen
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/memoizable.rb7
1 files changed, 3 insertions, 4 deletions
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