aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/memoizable.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/memoizable.rb')
-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}