<commit_before>class ContributorsController < ApplicationController
  after_action :cors_set_headers, only: :index

  respond_to :json

  def index
    @contributors = User.with_role(Role::CONTRIBUTOR_ROLES).includes(roles: :team).
      where("teams.season_id IS NULL OR teams.season_id = ?", Season.current).
      references(:teams).uniq
    respond_with @contributors.as_json(json_params)
  end

  private

  def json_params
    {
      only: [:github_handle, :avatar_url, :location, :country, :twitter_handle],
      methods: [:name_or_handle],
      include: [
        roles: {
          only: [:name],
          include: [team: { only: [:id, :name, :kind] }]
        }
      ]<commit_msg>only show contributors whose team is not nil – either sponsored or volunteer<commit_after>class ContributorsController < ApplicationController
  after_action :cors_set_headers, only: :index

  respond_to :json

  def index
    @contributors = User.with_role(Role::CONTRIBUTOR_ROLES).includes(roles: :team).
      where("teams.season_id IS NULL OR teams.season_id = ? and teams.kind IS NOT NULL", Season.current).
      references(:teams).uniq
    respond_with @contributors.as_json(json_params)
  end

  private

  def json_params
    {
      only: [:github_handle, :avatar_url, :location, :country, :twitter_handle],
      methods: [:name_or_handle],
      include: [
        roles: {
          only: [:name],
          include: [team: { only: [:id, :name, :kind] }]
        }
      ]
{'fraction_non_alphanumeric': 0.11621621621621622, 'fraction_numerical': 0.0, 'mean_word_length': 3.2680115273775217, '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': '357612', 'n_tokens_mistral': 480, 'n_tokens_neox': 470, 'n_words': 107}