<commit_before>class ReorderSectionsService
  def initialize(manual_repository:, context:)
    @manual_repository = manual_repository
    @context = context
  end

  def call
    manual.draft
    update
    persist
    export_draft_manual_to_publishing_api

    [manual, sections]
  end

private

  attr_reader :manual_repository, :context

  def update
    manual.reorder_sections(section_order)
  end

  def persist
    manual_repository.store(manual)
  end

  def sections
    manual.sections
  end

  def manual
    @manual ||= manual_repository.fetch(manual_id)
  end

  def manual_id
    context.params.fetch("manual_id")
  end<commit_msg>Use Manual.find vs manual_repository#fetch in ReorderSectionService<commit_after>class ReorderSectionsService
  def initialize(manual_repository:, context:)
    @manual_repository = manual_repository
    @context = context
  end

  def call
    manual.draft
    update
    persist
    export_draft_manual_to_publishing_api

    [manual, sections]
  end

private

  attr_reader :manual_repository, :context

  def update
    manual.reorder_sections(section_order)
  end

  def persist
    manual_repository.store(manual)
  end

  def sections
    manual.sections
  end

  def manual
    @manual ||= Manual.find(manual_id, context.current_user)
  end

  def manual_id
    context.params.fetch("manual_id")
  end
{'fraction_non_alphanumeric': 0.060561299852289516, 'fraction_numerical': 0.0, 'mean_word_length': 3.688581314878893, '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': '2352647', 'n_tokens_mistral': 445, 'n_tokens_neox': 404, 'n_words': 93}