def fetch_or_cache_partial(cached_partials, template, order_by:)
        order_by.each_with_object({}) do |cache_key, hash|
            hash[cache_key] =
              if content = cached_partials[cache_key]
                build_rendered_template(content, template)
              else
                yield.tap do |rendered_partial|
                  collection_cache.write(cache_key, rendered_partial.body)
                end
              end
          end
      end
def fetch_or_cache_partial(cached_partials, template, order_by:)
        order_by.each_with_object({}) do |cache_key, hash|
            hash[cache_key] =
              if content = cached_partials[cache_key]
                build_rendered_template(content, template)
              else
                yield.tap do |rendered_partial|
                  collection_cache.write(cache_key, rendered_partial.body)
                end
              end
          end
      end
`order_by` is an enumerable object containing keys of the cache,
 all keys are  passed in whether found already or not.

 `cached_partials` is a hash. If the value exists
 it represents the rendered partial from the cache
 otherwise `Hash#fetch` will take the value of its block.

 This method expects a block that will return the rendered
 partial. An example is to render all results
 for each element that was not found in the cache and store it as an array.
 Order it so that the first empty cache element in `cached_partials`
 corresponds to the first element in `rendered_partials`.

 If the partial is not already cached it will also be
 written back to the underlying cache store.