Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Check whether memoized ivar is initialized

  • Loading branch information...
commit 8b4461c1a405e52e22ee05dd8b46168402d02968 1 parent fd71a1a
@jeremy jeremy authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  activesupport/lib/active_support/memoizable.rb
View
2  activesupport/lib/active_support/memoizable.rb
@@ -60,7 +60,7 @@ def #{symbol}(*args)
#{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}
Please sign in to comment.
Something went wrong with that request. Please try again.