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)

298
299
300
# File 'actionview/lib/action_view/helpers/cache_helper.rb', line 298

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

#track_cachingObject


302
303
304
305
306
307
308
309
# File 'actionview/lib/action_view/helpers/cache_helper.rb', line 302

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