<commit_before>Spree::OrdersController.class_eval do

  # DD: stolen from orders_controller on Spree Core
  def reorder
    populator = Spree::OrderPopulator.new(current_order(true), current_currency)
    order = Spree::Order.where( number: params[:id] ).first

=begin
    # DD: ideally, create a params hash in this format and pass to populate, but it's not supported
    # +:products => { product_id => variant_id, product_id => variant_id }, :quantity => { variant_id => quantity, variant_id => quantity }+
    hash = { :products => {}, :quantity => {} }<commit_msg>current_order expects hash.<commit_after>Spree::OrdersController.class_eval do

  # DD: stolen from orders_controller on Spree Core
  def reorder
    populator = Spree::OrderPopulator.new(current_order(create_order_if_necessary: true), current_currency)
    order = Spree::Order.where( number: params[:id] ).first

=begin
    # DD: ideally, create a params hash in this format and pass to populate, but it's not supported
    # +:products => { product_id => variant_id, product_id => variant_id }, :quantity => { variant_id => quantity, variant_id => quantity }+
    hash = { :products => {}, :quantity => {} }
{'fraction_non_alphanumeric': 0.12383375742154368, 'fraction_numerical': 0.0, 'mean_word_length': 4.700483091787439, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, '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': '3516354', 'n_tokens_mistral': 357, 'n_tokens_neox': 340, 'n_words': 103}