<commit_before>module Spree

  ProductsController.class_eval do
    helper 'spree/taxons'
  
    def index
      @searcher = build_searcher(params)
      @products = @searcher.retrieve_products.where("auction_end >= ?", Date.today)
    end
  
    def show
      return unless @product

      product = Spree::Product.find_by_permalink(params[:id])
      @orders = Spree::Order.joins(line_items: [:variant]).where("spree_variants.product_id = ?", product.id).order("created_at")

      @variants = @product.variants_including_master.active(current_currency).includes([:option_values, :images])
      @product_properties = @product.product_properties.includes(:property)

      referer = request.env['HTTP_REFERER']
      if referer
        begin
          referer_path = URI.parse(request.env['HTTP_REFERER']).path
          # Fix for #2249
        rescue URI::InvalidURIError
          # Do nothing
        else
          if referer_path && referer_path.match(/\/t\/(.*)/)
            @taxon = Taxon.find_by_permalink($1)
          end
        end
      end
    end

  end
end<commit_msg>Updated Spree::Order collection for product.<commit_after>module Spree

  ProductsController.class_eval do
    helper 'spree/taxons'
  
    def index
      @searcher = build_searcher(params)
      @products = @searcher.retrieve_products.where("auction_end >= ?", Date.today)
    end
  
    def show
      return unless @product

      product = Spree::Product.find_by_permalink(params[:id])
      @orders = Spree::Order.joins(line_items: [:variant]).where("spree_variants.product_id = ? and user_id is not ?", product.id, nil).order("created_at")

      @variants = @product.variants_including_master.active(current_currency).includes([:option_values, :images])
      @product_properties = @product.product_properties.includes(:property)

      referer = request.env['HTTP_REFERER']
      if referer
        begin
          referer_path = URI.parse(request.env['HTTP_REFERER']).path
          # Fix for #2249
        rescue URI::InvalidURIError
          # Do nothing
        else
          if referer_path && referer_path.match(/\/t\/(.*)/)
            @taxon = Taxon.find_by_permalink($1)
          end
        end
      end
    end

  end
end
{'fraction_non_alphanumeric': 0.11509180474697717, 'fraction_numerical': 0.0044782803403493054, 'mean_word_length': 2.7864406779661017, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1212791', 'n_tokens_mistral': 705, 'n_tokens_neox': 700, 'n_words': 120}