1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Check whether memoized ivar is initialized

This commit is contained in:
Jeremy Kemper 2008-09-08 19:43:52 -07:00
parent fd71a1a354
commit 8b4461c1a4

View file

@ -60,7 +60,7 @@ module ActiveSupport
#{memoized_ivar} ||= {} unless frozen? #{memoized_ivar} ||= {} unless frozen?
reload = args.pop if args.last == true || args.last == :reload 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) if !reload && #{memoized_ivar}.has_key?(args)
#{memoized_ivar}[args] #{memoized_ivar}[args]
elsif #{memoized_ivar} elsif #{memoized_ivar}