Skip to content

Commit

Permalink
Use correct cache key on Products search page
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill Kaiumov authored and damianlegawiec committed Nov 22, 2019
1 parent b232216 commit dda1b11
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frontend/app/controllers/spree/products_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def load_variants
end

def load_products
retrieved = Rails.cache.fetch params.permit do
retrieved = Rails.cache.fetch params.permit! do
searcher = build_searcher(params.merge(include_images: true))
products = searcher.retrieve_products.includes(:variants_including_master, master: :default_price)
products_total_count = products.total_count
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/views/spree/products/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<%= render 'spree/products/filters_desktop', permitted_params: permitted_params %>
<div class="col-md-12 col-lg-8" data-hook="homepage_products">
<div class="row">
<% cache params.permit do %>
<% cache(params.permit!) do %>
<% @products.each do |product| %>
<div class="col-lg-6 col-sm-4 col-6 mb-3 mb-md-4 pr-0 pl-md-4 pl-sm-4">
<%= render 'spree/shared/product', product: product, image_class: 'product-component-plp-image' %>
Expand Down

0 comments on commit dda1b11

Please sign in to comment.