Skip to content

Commit

Permalink
Merge pull request #10 from 20jeans/rails4
Browse files Browse the repository at this point in the history
rails4 session does not have fetch
  • Loading branch information
JDutil committed Oct 9, 2013
2 parents 5c659e1 + d818b3c commit 7e319ed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/spree/products_controller_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

def recently_viewed
id = @product.id
rvp = session.fetch("recently_viewed_products", "").split(', ')
rvp = (session["recently_viewed_products"] || "").split(', ')
rvp.delete(id)
rvp << id unless rvp.include?(id.to_s)
rvp_max_count = Spree::RecentlyViewed::Config[:recently_viewed_products_max_count] || 5
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/spree/base_helper_decorator.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Spree::BaseHelper.module_eval do
def get_recently_viewed_products_ids
session.fetch("recently_viewed_products", "").split(', ')
(session["recently_viewed_products"] || "").split(', ')
end

def get_recently_viewed_products
Expand Down

0 comments on commit 7e319ed

Please sign in to comment.