Module: ActionView::Helpers::CacheHelper::CachingRegistry

Extended by:
CachingRegistry
Included in:
CachingRegistry
Defined in:
lib/action_view/helpers/cache_helper.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#caching?Boolean

Returns:

  • (Boolean)


300
301
302
# File 'lib/action_view/helpers/cache_helper.rb', line 300

def caching?
  ActiveSupport::IsolatedExecutionState[:action_view_caching] ||= false
end

#track_cachingObject



304
305
306
307
308
309
310
311
# File 'lib/action_view/helpers/cache_helper.rb', line 304

def track_caching
  caching_was = ActiveSupport::IsolatedExecutionState[:action_view_caching]
  ActiveSupport::IsolatedExecutionState[:action_view_caching] = true

  yield
ensure
  ActiveSupport::IsolatedExecutionState[:action_view_caching] = caching_was
end