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

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

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#caching?Boolean

Returns:

  • (Boolean)


292
293
294
# File 'actionview/lib/action_view/helpers/cache_helper.rb', line 292

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

#track_cachingObject



296
297
298
299
300
301
302
303
# File 'actionview/lib/action_view/helpers/cache_helper.rb', line 296

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