<commit_before>class OrderUpdater
  attr_reader :order, :params

  def initialize(order, params)
    @order = order
    @params = params
  end

  def update
    update_notes
    update_details
    update_tracking_details
    update_address
    update_status
  end

  private

  def update_details
    OrderDetailsUpdater.new(order, params).update
  end

  def update_notes
    return unless params[:order].present? && params[:order].include?(:notes)
    order.notes = params[:order][:notes]
  end

  def update_tracking_details
    return unless params[:order].present? && params[:order][:tracking_details].present?
    order.add_tracking_details(params)
  end

  def update_address
    return unless params[:order].present? && params[:order][:ship_to_address].present?
    order.ship_to_address = params[:order][:ship_to_address]
  end

  def update_status
    return unless params[:order].present? && params[:order][:status].present?
    order.update_status(params[:order][:status], params)
  end
end<commit_msg>Fix ship_to_name not being saved<commit_after>class OrderUpdater
  attr_reader :order, :params

  def initialize(order, params)
    @order = order
    @params = params
  end

  def update
    return unless params[:order].present?
    update_notes
    update_details
    update_tracking_details
    update_address
    update_ship_to_name
    update_status
  end

  private

  def update_details
    OrderDetailsUpdater.new(order, params).update
  end

  def update_notes
    return unless params[:order].include?(:notes)
    order.notes = params[:order][:notes]
  end

  def update_tracking_details
    return unless params[:order][:tracking_details].present?
    order.add_tracking_details(params)
  end

  def update_address
    return unless params[:order][:ship_to_address].present?
    order.ship_to_address = params[:order][:ship_to_address]
  end

  def update_ship_to_name
    return unless params[:order][:ship_to_name].present?
    order.ship_to_name = params[:order][:ship_to_name]
  end

  def update_status
    return unless params[:order][:status].present?
    order.update_status(params[:order][:status], params)
  end
end
{'fraction_non_alphanumeric': 0.09627906976744185, 'fraction_numerical': 0.0, 'mean_word_length': 4.298029556650246, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7629786', 'n_tokens_mistral': 666, 'n_tokens_neox': 644, 'n_words': 137}