Module: CacheDebugging::StrictDependencies
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/cache_debugging/strict_dependencies.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#render_with_template_dependencies(*args, &block) ⇒ Object
every time we render, we want to check if the partial is in the dependency list.
Class Method Details
.strict_dependencies_enabled? ⇒ Boolean
5 6 7 |
# File 'lib/cache_debugging/strict_dependencies.rb', line 5 def self.strict_dependencies_enabled? !!Rails.application.config.cache_debugging.strict_dependencies end |
Instance Method Details
#render_with_template_dependencies(*args, &block) ⇒ Object
every time we render, we want to check if the partial is in the dependency list
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/cache_debugging/strict_dependencies.rb', line 14 def render_with_template_dependencies(*args, &block) if CacheDebugging::StrictDependencies.strict_dependencies_enabled? && cache_blocks.length > 0 = args.first if .is_a?(Hash) if partial = [:partial] validate_partial!(partial) end else (.respond_to?(:to_ary) ? .to_ary : Array()).each do |object| validate_partial!(Utils.object_partial_path(object)) end end end render_without_template_dependencies(*args, &block) end |