def prevent_recursion!(template)
      # If this template is not a real file it cannot ever conflict.
      return unless template.real_source_path

      caller_templates = template_nesting.select do |t|
        t.real_source_path == template.real_source_path
      end

      # We're good, no deeper recursion then MAX_ALLOWED_TEMPLATE_NESTING
      return if caller_templates.length <= MAX_ALLOWED_TEMPLATE_NESTING

      err = "Recursive render detected for '#{template.source_path}'"
      err += " in '#{current_template.source_path}'"

      raise ArgumentError, err
    end
def prevent_recursion!(template)
      # If this template is not a real file it cannot ever conflict.
      return unless template.real_source_path

      caller_templates = template_nesting.select do |t|
        t.real_source_path == template.real_source_path
      end

      # We're good, no deeper recursion then MAX_ALLOWED_TEMPLATE_NESTING
      return if caller_templates.length <= MAX_ALLOWED_TEMPLATE_NESTING

      err = "Recursive render detected for '#{template.source_path}'"
      err += " in '#{current_template.source_path}'"

      raise ArgumentError, err
    end
Will check the template nesting if we haven't already
 rendered this path before. If it has we'll throw an argumenteerror