<commit_before>class CurrentsController < ApplicationController
  before_action :set_current, only: [:show, :edit, :update, :destroy]
  before_filter :authenticate_user!, :except => [:index, :show]

  # GET /currents
  # GET /currents.json
  def index
    @currents = Current.all
  end

  # GET /currents/:id
  # GET /currents/:id.json
  def show
  end

  # GET /currents/new
  def new
    @current = Current.new
  end

  # GET /currents/:id/edit
  def edit
  end

  # POST /currents
  # POST /currents.json
  def create
    @current = Current.new(current_params)

    respond_to do |format|
      if @current.save
        format.html { redirect_to @current, notice: 'Current was successfully created.' }
        format.json { render action: 'show', status: :created, location: @current }
      else
        format.html { render action: 'new' }
        format.json { render json: @current.errors, status: :unprocessable_entity }<commit_msg>Set Currents owner in 'create' action<commit_after>class CurrentsController < ApplicationController
  before_action :set_current, only: [:show, :edit, :update, :destroy]
  before_filter :authenticate_user!, :except => [:index, :show]

  # GET /currents
  # GET /currents.json
  def index
    @currents = Current.all
  end

  # GET /currents/:id
  # GET /currents/:id.json
  def show
  end

  # GET /currents/new
  def new
    @current = Current.new
  end

  # GET /currents/:id/edit
  def edit
  end

  # POST /currents
  # POST /currents.json
  def create

    @current = Current.new(current_params)
    @current.owner = current_user

    respond_to do |format|
      if @current.save
        format.html { redirect_to @current, notice: 'Current was successfully created.' }
        format.json { render action: 'show', status: :created, location: @current }
      else
        format.html { render action: 'new' }
        format.json { render json: @current.errors, status: :unprocessable_entity }
{'fraction_non_alphanumeric': 0.110881897885508, 'fraction_numerical': 0.0, 'mean_word_length': 3.0332640332640333, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1994898', 'n_tokens_mistral': 626, 'n_tokens_neox': 610, 'n_words': 173}