<commit_before>class SubmissionController < ApplicationController
  before_filter :clean_submissions, :only => :create
  before_filter :submitter?

  allow_param({
    :submission => [
      :title,
      :text
    ],
  }, {
    :only => :create
  })

  def show
    @submission = @account.submissions.where({
      :current => true
    })

    case true
    when @submission.blank?   then raise UnauthorizedError
    when @submission.size > 1 then raise ServerError
    else
      @submission = @submission.first
      @title      = @submission.title
    end
  end

  alias_method :edit, :show

  def create
    if @account.submissions.create(safe_params[:submission])<commit_msg>Fix that, it should be _submitter?<commit_after>class SubmissionController < ApplicationController
  before_filter :clean_submissions, :only => :create
  before_filter :_submitter?

  allow_param({
    :submission => [
      :title,
      :text
    ],
  }, {
    :only => :create
  })

  def show
    @submission = @account.submissions.where({
      :current => true
    })

    case true
    when @submission.blank?   then raise UnauthorizedError
    when @submission.size > 1 then raise ServerError
    else
      @submission = @submission.first
      @title      = @submission.title
    end
  end

  alias_method :edit, :show

  def create
    if @account.submissions.create(safe_params[:submission])
{'fraction_non_alphanumeric': 0.10115606936416185, 'fraction_numerical': 0.001445086705202312, 'mean_word_length': 2.9124293785310735, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '4925608', 'n_tokens_mistral': 433, 'n_tokens_neox': 414, 'n_words': 100}