<commit_before>class VariantTypesController < ApplicationController

  actions_without_auth :index, :relationships

  def index
    variant_types = FilterAdapters::VariantType.filter_query(
      VariantType.page(params[:page])
        .per(params[:count]),
      params
    )

    render json: PaginatedCollectionPresenter.new(
      variant_types,
      request,
      VariantTypePresenter,
      PaginationPresenter
    )
  end

  def relationships
    variant = Variant.eager_load(:variant_types)
      .find(params[:variant_id])

    new_vt = VariantType.find(params[:variant_type_id])

    relationships = variant.variant_types.map do |existing_vt|
      {
        variant_type: existing_vt.name,
        variant_type_id: existing_vt.id,
        relationship: existing_vt.relationship_with(new_vt),
      }
    end
<commit_msg>use full variant type presenter<commit_after>class VariantTypesController < ApplicationController

  actions_without_auth :index, :relationships

  def index
    variant_types = FilterAdapters::VariantType.filter_query(
      VariantType.page(params[:page])
        .per(params[:count]),
      params
    )

    render json: PaginatedCollectionPresenter.new(
      variant_types,
      request,
      VariantTypePresenter,
      PaginationPresenter
    )
  end

  def relationships
    variant = Variant.eager_load(:variant_types)
      .find(params[:variant_id])

    new_vt = VariantType.find(params[:variant_type_id])

    relationships = variant.variant_types.map do |existing_vt|
      {
        variant_type: VariantTypePresenter.new(existing_vt),
        relationship: existing_vt.relationship_with(new_vt)
      }
    end

{'fraction_non_alphanumeric': 0.08177991581479255, 'fraction_numerical': 0.0, 'mean_word_length': 3.4021164021164023, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3509448', 'n_tokens_mistral': 500, 'n_tokens_neox': 477, 'n_words': 80}