aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-09-08 19:43:52 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2008-09-08 19:43:52 -0700
commit8b4461c1a405e52e22ee05dd8b46168402d02968 (patch)
treea7d0f2057de7023a216233fe65c94e1415f89e07 /activesupport
parentfd71a1a354f96a74556346920ff61e80b91d8af0 (diff)
downloadrails-8b4461c1a405e52e22ee05dd8b46168402d02968.tar.gz
rails-8b4461c1a405e52e22ee05dd8b46168402d02968.tar.bz2
rails-8b4461c1a405e52e22ee05dd8b46168402d02968.zip
Check whether memoized ivar is initialized
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/memoizable.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/memoizable.rb b/activesupport/lib/active_support/memoizable.rb
index 6506238ac0..4786fd6e0b 100644
--- a/activesupport/lib/active_support/memoizable.rb
+++ b/activesupport/lib/active_support/memoizable.rb
@@ -60,7 +60,7 @@ module ActiveSupport
#{memoized_ivar} ||= {} unless frozen?
reload = args.pop if args.last == true || args.last == :reload
- if #{memoized_ivar}
+ if defined?(#{memoized_ivar}) && #{memoized_ivar}
if !reload && #{memoized_ivar}.has_key?(args)
#{memoized_ivar}[args]
elsif #{memoized_ivar}