<commit_before>class V1::PeopleController < V1::BaseController

  def create
    person = Person.create_or_update(person_params)
    render json: { id: person.id }, status: 200
  end

  def targets
    person = Person.find_or_initialize_by(email: params[:email])
    if person.save
      person.update_location(location_params.symbolize_keys)
      @target_legislators = person.target_legislators(json: true)
      @address_required   = person.address_required?
    else
      @error = "person not found"
    end
    render
  end

  private

  def person_params
    params.require(:person).permit(:email, :phone, :first_name, :last_name,
                                   :address, :zip, remote_fields: [:event_id, tags: []])
  end

  def location_params
    params.permit(:address, :zip)
  end
end
<commit_msg>add volunteer field to people controller<commit_after>class V1::PeopleController < V1::BaseController

  def create
    person = Person.create_or_update(person_params)
    render json: { id: person.id }, status: 200
  end

  def targets
    person = Person.find_or_initialize_by(email: params[:email])
    if person.save
      person.update_location(location_params.symbolize_keys)
      @target_legislators = person.target_legislators(json: true)
      @address_required   = person.address_required?
    else
      @error = "person not found"
    end
    render
  end

  private

  def person_params
    params.require(:person).permit(:email, :phone, :first_name, :last_name,
      :address, :zip, remote_fields: [:event_id, :is_volunteer, tags: []])
  end

  def location_params
    params.permit(:address, :zip)
  end
end

{'fraction_non_alphanumeric': 0.09773976786805132, 'fraction_numerical': 0.006108735491753207, 'mean_word_length': 3.4754098360655736, '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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2963871', 'n_tokens_mistral': 523, 'n_tokens_neox': 505, 'n_words': 114}