<commit_before>class Spree::WishlistsController < Spree::BaseController
  helper 'spree/products'

  respond_to :html
  respond_to :js, :only => [:update]

  def new
    @wishlist = Spree::Wishlist.new

    respond_with(@wishlist)
  end

  def edit
    @wishlist = Spree::Wishlist.find_by_access_hash(params[:id])

    respond_with(@wishlist)
  end

  def update
    @wishlist = Spree::Wishlist.find_by_access_hash(params[:id])
    @wishlist.update_attributes(params[:wishlist])

    respond_with(@wishlist)
  end

  def show
    @wishlists = current_user.wishlists
    @wishlist = Spree::Wishlist.find_by_access_hash(params[:id])

    respond_with(@wishlist)
  end

  def create
    @wishlist = Spree::Wishlist.new(params[:wishlist])
    @wishlist.user = current_user

    @wishlist.save
    respond_with(@wishlist)
  end

  def destroy
    @wishlist = Spree::Wishlist.find_by_access_hash(params[:id])
    @wishlist.destroy
    respond_with(@wishlist )do |format|
      format.html { redirect_to account_path }
    end
  end

end<commit_msg>remove @wishlists from controller (only referenced in one spot in the entire extension).  This allows us to not crash when entering wishlists#show when not logged in<commit_after>class Spree::WishlistsController < Spree::BaseController
  helper 'spree/products'

  respond_to :html
  respond_to :js, :only => [:update]

  def new
    @wishlist = Spree::Wishlist.new

    respond_with(@wishlist)
  end

  def edit
    @wishlist = Spree::Wishlist.find_by_access_hash(params[:id])

    respond_with(@wishlist)
  end

  def update
    @wishlist = Spree::Wishlist.find_by_access_hash(params[:id])
    @wishlist.update_attributes(params[:wishlist])

    respond_with(@wishlist)
  end

  def show
    @wishlist = Spree::Wishlist.find_by_access_hash(params[:id])

    respond_with(@wishlist)
  end

  def create
    @wishlist = Spree::Wishlist.new(params[:wishlist])
    @wishlist.user = current_user

    @wishlist.save
    respond_with(@wishlist)
  end

  def destroy
    @wishlist = Spree::Wishlist.find_by_access_hash(params[:id])
    @wishlist.destroy
    respond_with(@wishlist )do |format|
      format.html { redirect_to account_path }
    end
  end

end
{'fraction_non_alphanumeric': 0.10564663023679417, 'fraction_numerical': 0.0, 'mean_word_length': 4.085648148148148, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2392597', 'n_tokens_mistral': 802, 'n_tokens_neox': 776, 'n_words': 144}