<commit_before>class Section < Sequel::Model
  plugin :json_serializer

  many_to_many :chapters, right_key: :goods_nomenclature_sid,
                          join_table: :chapters_sections

  def to_param
    position
  end
end<commit_msg>Chapter and section association should be time bound.<commit_after>class Section < Sequel::Model
  plugin :json_serializer

  many_to_many :chapters, dataset: -> {
    Chapter.join_table(:inner, :chapters_sections, chapters_sections__goods_nomenclature_sid: :goods_nomenclatures__goods_nomenclature_sid)
           .join_table(:inner, :sections, chapters_sections__section_id: :sections__id)
           .with_actual(Chapter)
           .where(sections__id: id)
  }

  def to_param
    position
  end
end
{'fraction_non_alphanumeric': 0.07258064516129033, 'fraction_numerical': 0.0, 'mean_word_length': 3.966666666666667, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '1031661', 'n_tokens_mistral': 238, 'n_tokens_neox': 224, 'n_words': 46}