<commit_before>class API::VotesController < API::RestfulController
  load_resource only: [:create]

  def index
    @votes = Vote.where(motion: @motion)
                 .most_recent
                 .order(:created_at)
    respond_with_collection
  end

  def create
    VoteService.create vote: @vote, actor: current_user
    respond_with_resource
  end

  def my_votes
    @votes = @discussion.votes.most_recent.for_user(current_user)
    respond_with_collection
  end

  private
  def vote_params
    params.require(:vote).permit(:position, :statement, :motion_id)<commit_msg>Fix my_votes<commit_after>class API::VotesController < API::RestfulController
  load_resource only: [:create]

  def index
    @votes = Vote.where(motion: @motion)
                 .most_recent
                 .order(:created_at)
    respond_with_collection
  end

  def create
    VoteService.create vote: @vote, actor: current_user
    respond_with_resource
  end

  def my_votes
    load_and_authorize_discussion
    @votes = @discussion.votes.most_recent.for_user(current_user)
    respond_with_collection
  end

  private
  def vote_params
    params.require(:vote).permit(:position, :statement, :motion_id)
{'fraction_non_alphanumeric': 0.08214585079631181, 'fraction_numerical': 0.0, 'mean_word_length': 3.4386617100371746, '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': '5202467', 'n_tokens_mistral': 392, 'n_tokens_neox': 367, 'n_words': 73}